Prototype Design Pattern
Learn Prototype pattern in Java. Create objects by cloning existing ones. Implement deep copy and configuration templates.
The 23 Gang of Four patterns explained with practical Java code and real-world use cases. Each article breaks down when to use the pattern, how it works under the hood, and where it appears in production frameworks like Spring, JDK, and Android. Organized by Creational, Structural, and Behavioral categories.
25 articles and countingPatterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
Learn Prototype pattern in Java. Create objects by cloning existing ones. Implement deep copy and configuration templates.
Learn Abstract Factory pattern in Java. Create families of related objects without specifying concrete classes.
Learn Builder pattern in Java. Construct complex objects step by step with fluent interfaces. Handle optional parameters cleanly.
Learn Factory Method pattern in Java. Let subclasses decide which objects to create. Includes real-world examples and code.
Learn Singleton pattern in Java. Ensure one instance with global access. Covers thread-safe implementation and common pitfalls.
Patterns that ease the design by identifying a simple way to realize relationships between entities.
Learn Flyweight pattern in Java. Share state to support large numbers of objects efficiently. Text editor and game examples.
Learn Bridge pattern in Java. Separate abstraction from implementation to avoid class explosion. Cross-platform examples.
Learn Composite pattern in Java. Treat individual objects and compositions uniformly. Build tree structures like file systems.
Learn Proxy pattern in Java. Control access to objects with virtual, protection, and remote proxies. Includes lazy loading examples.
Learn Facade pattern in Java. Provide a simple interface to complex subsystems. Reduce coupling and create clean APIs.
Learn Adapter pattern in Java. Make incompatible interfaces work together. Integrate legacy systems and third-party libraries.
How filter design pattern works and what are the use cases. This article explains filter design pattern with the help...
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.
Learn Visitor pattern in Java. Add operations to object structures without modifying classes. Uses double dispatch.
Learn Interpreter pattern in Java. Evaluate domain-specific languages with abstract syntax trees. Build expression parsers.
Learn Memento pattern in Java. Capture and restore object state for undo/redo without violating encapsulation.
Learn Iterator pattern in Java. Traverse collections without exposing internals. Implement custom iterators with examples.
Learn Mediator pattern in Java. Centralize complex communication between objects. Reduce coupling in chat rooms and UIs.
Learn Chain of Responsibility in Java. Pass requests through a chain of handlers. Used in middleware and validation.
Learn Template Method pattern in Java. Define algorithm skeleton in base class, let subclasses override specific steps.
Learn State pattern in Java. Let objects change behavior based on internal state. Replace complex conditionals with state machines.
Learn Command pattern in Java. Encapsulate requests as objects for undo/redo, queuing, and logging. Practical code examples.
Learn Strategy pattern in Java. Swap algorithms at runtime without changing client code. Includes payment and sorting examples.
How observer design pattern works and what are the use cases. This article explains observer design pattern with the help...