Prototype Design Pattern
Copy existing objects without depending on their classes
Design patterns are proven solutions to recurring problems in software design. The Gang of Four (GoF) catalogued 23 patterns in their seminal 1994 book, organized into three categories based on their purpose.
Patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
Copy existing objects without depending on their classes
Build consistent object families without specifying concrete classes
Create objects with many optional parameters without telescoping constructors
Decouple object creation from the code that uses objects
Control object creation and share state across your application
Patterns that ease the design by identifying a simple way to realize relationships between entities.
Reduce memory by sharing common data between similar objects
Vary what something does and how it does it independently
Build tree structures where clients don't distinguish between leaves and branches
Add a layer of control without changing the original object
Hide complexity behind a simple, unified API
Connect components that weren't designed to connect
How filter design pattern works and what are the use cases. This article explains filter design pattern with the help of an example.
Decorator Design Pattern is very useful when it comes to modifying the characteristics or functionality of an object at runtime.
Patterns that identify common communication patterns between objects and realize these patterns.
Separate algorithms from the objects they operate on
Build grammars and interpret expressions for custom languages
Save snapshots for undo, checkpoints, and rollback
Access elements sequentially without knowing the underlying structure
Reduce chaotic dependencies by having objects communicate through a central hub
Decouple senders from receivers by giving multiple objects a chance to handle requests
Use inheritance to vary parts of an algorithm
Replace conditional logic with polymorphic state objects
Queue, log, and undo operations by encapsulating them as objects
Define a family of algorithms and make them interchangeable
How observer design pattern works and what are the use cases. This article explains observer design pattern with the help of an example.