Skip to content

jkey774/design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design Patterns


Behavioral Patterns

Memento: Allows restoring an object to a previous state.

State: Allows an object to behave differently depending on the state it is in.

Iterator: Allows iterating over an object without having to expose the object’s internal structure (which may change in the future).

Strategy: Allows passing different algorithms (behaviours) to an object. Allows defining a template (skeleton) for an operation. Specific steps will then be implemented in subclasses.

Command: Allows decouple a sender from a receiver. The sender will talk to the receive through a command. Commands can be undone and persisted.

Observer: Allows an object notify other objects when its state changes.

Mediator: Allows an object to encapsulate the communication between other objects.

Chain of Responsibility: Allows building a chain of objects to process a request.

Visitor: Allows adding new operations to an object structure without modifying it.


Structural Patterns

Composite: Represents object hierarchies where individual objects and compositions of objects are treated the same way.

Adapter: Allows converting the interface of a class into another interface that clients expect.

Decorator: Adds additional behavior to an object dynamically.

Facade: Provides a simplified, higher-level interface to a subsystem. Clients can talk to the facade rather than individual classes in the subsystem.

Flyweight: Allows sharing common state between multiple objects.

Bridge: Allows representing hierarchies that grow in two different dimensions independently.

Proxy: Allows providing a substitute for another object. The proxy object delegates all the work to the target object and contains some additional behavior.

About

Examples of design patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published