Skip to content

Page 23

Software Craft2 min read

SP3 - Tree - Learn Design Pattern From Simple Things

You need to store the leaves hierarchically, sometimes you will count the leaves. Tree will be a suitable structure to facilitate leaf counting.

#design-patterns#structural-patterns
Software Craft3 min read

CP5 - Singleton - Learn Design Pattern From Simple Things

Maintain one phone line indefinitely instead of repeatedly connecting and disconnecting. Learn the Singleton design pattern from simple things.

#design-patterns#creational-patterns
Software Craft4 min read

CP4 - Prototype - Learn Design Pattern From Simple Things

Having been with you for a long time, your robot has memories that regular manufacturing can't produce, now you want to clone it. Prototype will be your remedy.

#design-patterns#creational-patterns
Software Craft3 min read

BP2 - Strategy - Learn Design Pattern From Simple Things

As the coach of a strong team, you plan to attack to find a goal and then prioritize possession to preserve the score. This combination is called strategy.

#design-patterns#behavioral-patterns
Software Craft7 min read

SP2 - Decorator & Function Decorator & Closure - Learn Design Pattern From Simple Things

Ice cream gets better with extra flavor - and code gets richer with the Decorator pattern. Learn closures, function decorators, and object wrapping.

#design-patterns#structural-patterns
Software Craft2 min read

CP3 - Builder - Design Pattern From Simple Things

Building a house involves bringing together many parts, each house has its own specific requirements, you need a builder who can easily implement what you want.

#design-patterns#creational-patterns
Software Craft3 min read

BP1 - Gun (Iterator) - Design Pattern From Simple Things

There are bullets that need to be fired one by one in a specific order. You need a tool to set it up neatly and easily upgrade later.

#design-patterns#behavioral-patterns
Software Craft5 min read

CP2 - Comparison between Factories: Simple Factory & Factory Method & Abstract Factory - Design Pattern From Simple Things

Simple Factory is da best, Factory Method and Abstract Factory are cumbersome, complicated and stupid?

#design-patterns#creational-patterns
Software Craft3 min read

CP1 - Vending Machine (Factory) - Design Pattern From Simple Things

Beverages scattered across stores - too tiring to search each one. Learn how the Factory pattern centralizes object creation cleanly.

#design-patterns#creational-patterns