Patterns Flashcards
List pattern examples in JDK
Builder, Factory method,
Prototype - Objects.clone()
Singleton - System
Adapter - Arrays.asList()
Chain of responsibility - logger
Iterator - Iterator
Ptroxy - reflection
Observer - listener
Facade
Structural
Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use
Proxy
Structural
Provide placeholder for another object to control access to it.
Decorator
Structural
attach additional responsibilities to an object dynamically
alternative to subclassing for extending functionality
Strategy
Define a family of algorithms, encapsulate each one, and make them interchangeable.
Strategy lets the algorithm vary independently from clients that use it.
Observer
Define a one-to-many dependency between objects so that when one object changes state,
all its dependents are notified and updated automatically.
Bridge
Decouple an abstraction from its implementation so that the two can vary independently.
Singleton
Ensure a class only has one instance, and provide a global point of access to it.
Flyweight
minimizes memory use by sharing as much data as possible with other similar objects
Builder
Separate the construction of a complex object from its representation
so that the same construction process can create different representations.