Conceptly

Understand design-pattern visually

Explore each concept's architecture through animated diagrams. Click a card to dive deeper.

๐Ÿ“ฒCaller1๏ธโƒฃSingleton๐Ÿ“ฆInstance
1๏ธโƒฃ

Singleton

A creational pattern that ensures only one instance exists per process

Singleton is a creational pattern that guarantees exactly one instance of a class exists within a process and provides a global access point to that instance. Because the constructor is hidden and the object is only exposed through a static method, the same instance is returned regardless of who calls it or when.

๐Ÿ“ฒClient๐ŸญFactory๐Ÿ“ฆProduct
๐Ÿญ

Factory Method

A creational pattern that delegates object creation to subclasses

Factory Method is a creational pattern that delegates object creation responsibility to subclasses instead of writing creation code directly. The superclass (Creator) defines only the interface for 'what to create,' while the subclass (ConcreteCreator) decides which concrete object to instantiate. Because the client depends only on the Product interface, switching concrete classes does not change the calling code.

๐Ÿ“ฑClient๐ŸญAbstract Factory๐Ÿ“ฆProduct Family
๐Ÿญ

Abstract Factory

An interface for consistently creating families of related objects

Abstract Factory is a creational pattern that lets you create families of related objects without specifying their concrete classes. Client code depends only on the factory interface, so which product family gets created is determined at runtime.

๐Ÿ“‹Director๐Ÿ”งBuilder๐Ÿ—๏ธProduct
๐Ÿ”ง

Builder

A pattern that separates the construction of a complex object into steps

Builder is a creational pattern that separates the construction of a complex object into discrete steps, so the same construction procedure can produce objects of different representations. Instead of cramming all parameters into a constructor at once, you set the needed parts one at a time and receive the finished object at the end.

๐Ÿ“ฑClient๐Ÿ”ŒAdapterโš™๏ธAdaptee
๐Ÿ”Œ

Adapter

A structural pattern that bridges incompatible interfaces

Adapter is a structural pattern that bridges two incompatible interfaces by sitting between them and translating calls. When the interface the client expects (Target) differs from the interface of the class you want to use (Adaptee), the Adapter converts calls between the two. It works just like a power plug adapter. You cannot plug a US plug into a Korean outlet, but with an adapter in between, the electricity flows just the same. In software, the Adapter's starting point is a situation where only the interface is mismatched while the underlying functionality is perfectly usable.

๐Ÿ“ฑClient๐ŸšชFacade๐Ÿ—๏ธSubsystem
๐Ÿšช

Facade

A structural pattern that provides a simple entry point to a complex subsystem

Facade is a structural pattern that places a simplified interface over a group of complex subsystems. It lets the client achieve the desired result with a single method call, without needing to know the initialization order, dependency relationships, or calling conventions of multiple classes. Think of a hotel front desk. A guest does not need to contact room assignment, key issuance, and breakfast reservation departments separately -- the front desk handles everything at once. Multiple departments operate behind the scenes, but the guest need not be aware of that.

๐Ÿ“ฑClient๐Ÿ›ก๏ธProxyโš™๏ธReal Object
๐Ÿ›ก๏ธ

Proxy

A surrogate object that controls access to the real object

Proxy is a structural pattern that places a surrogate object in front of the real object to control access. The Client sends requests through the same interface to the Proxy, and the Proxy performs additional logic -- access control, caching, lazy loading -- before delegating to the real object when necessary. Think of an executive's assistant. External contacts go through the assistant rather than reaching the executive directly. The assistant checks schedules, assesses urgency, and sometimes handles things without involving the executive at all. The requester uses the same communication channel regardless, so the difference is invisible.

๐Ÿ“จClient๐ŸŽ€Decorator๐Ÿ“ฆComponent
๐ŸŽ€

Decorator

A structural pattern that dynamically adds behavior to an object

Decorator is a structural pattern that wraps an object in a same-interface wrapper to add functionality without modifying the original code. Because both the wrapper and the wrapped object implement the same interface, the client does not need to know whether it is using the original or a decorated version.

๐Ÿ“จClient๐ŸŒฒComposite๐ŸƒLeaf
๐ŸŒฒ

Composite

A tree-structure pattern that treats individual and composite objects uniformly

Composite is a structural pattern that lets individual objects and groups of objects be treated through the same interface. It builds a tree structure while allowing the client to call the same method without caring whether the target is a leaf node or a group.

๐Ÿ“กSubject๐Ÿ‘๏ธObserver๐Ÿ””Update
๐Ÿ‘๏ธ

Observer

A behavioral pattern that automatically propagates state changes to subscribers

Observer is a pattern that automatically notifies other objects when an object's state changes. It separates the state-holding side (Subject) from the watching side (Observer), so the Subject does not need to know who is watching and Observers can start or stop subscribing at any time.

๐Ÿ“ฆContext๐ŸŽฏStrategyโœ…Result
๐ŸŽฏ

Strategy

A behavioral pattern that encapsulates algorithms and makes them interchangeable at runtime

Strategy is a pattern that separates multiple algorithms serving the same purpose into individual classes and lets the consumer (Context) select and execute one. Because the code that uses the algorithm is separated from the algorithm itself, adding new algorithms or changing existing ones does not require modifying the calling side.

๐Ÿ”˜Invoker๐Ÿ“‹Commandโš™๏ธReceiver
๐Ÿ“‹

Command

A behavioral pattern that encapsulates requests as objects for execution, undo, and queuing

Command is a pattern that turns a request -- 'do this' -- into a standalone object. The side sending the request (Invoker) does not know what the request specifically does or how, and the side performing the work (Receiver) does not know who requested it. Once a request becomes an object, it can be stored, transmitted, undone, and replayed.

๐Ÿ‘คClient๐Ÿ”„Iterator๐Ÿ“ฆCollection
๐Ÿ”„

Iterator

A pattern that traverses collection elements sequentially while hiding the internal structure

Iterator is a behavioral pattern that lets you access elements of a collection one by one in sequence without exposing the collection's internal structure. The client uses only a common interface like next() and hasNext(), without caring whether the data is stored in an array, a tree, or a hash map.

๐Ÿ“Template๐Ÿ“‹Steps๐Ÿ”งSubclass
๐Ÿ“

Template Method

A pattern that fixes the algorithm skeleton and delegates specific steps to subclasses

Template Method is a behavioral pattern that defines the overall structure of an algorithm in a parent-class method and delegates the implementation of certain steps to subclasses. The skeleton is managed in one place; only the way the details are filled in varies.