Software Architecture Design Patterns Flashcards
(46 cards)
Delegation
Let an object hand off work to a helper object; useful for sharing behavior without inheritance.
Interface
Define a contract of operations without implementation; implemented by concrete classes to ensure consistency.
Abstract Superclass
Factor out shared code into a base class with abstract methods for subclass-specific behavior.
Interface and Abstract Class
Define an API via an interface and share default code via an abstract class.
Immutable
Create objects whose state cannot change after construction; ensures thread-safety.
Marker Interface
Empty interface used to tag classes with metadata for special handling (e.g., Serializable).
Proxy
Provide a surrogate for another object to control access, add behavior, or lazy-load the real subject.
Factory Method
Define an interface for creating an object, but let subclasses decide which concrete class to instantiate.
Abstract Factory
Provide an interface for creating families of related objects without specifying their concrete classes.
Builder
Separate construction of a complex object from its representation, allowing step-by-step creation.
Prototype
Clone existing objects instead of creating from scratch; useful for performance-sensitive creation.
Singleton
Ensure a class has only one instance and provide a global point of access to it.
Object Pool
Reuse a set of initialized objects instead of creating/destroying them repeatedly.
Filter
Process a stream of data through a chain of filters, each performing part of the work.
Composite
Compose objects into tree structures to represent part-whole hierarchies; treat leaves and composites uniformly.
Read-Only Interface
Expose only read operations to certain clients by providing an interface without mutators.
Adapter
Convert the interface of a class into another interface clients expect by wrapping it.
Iterator
Provide sequential access to the elements of an aggregate without exposing its representation.
Bridge
Decouple an abstraction from its implementation so both can vary independently.
Façade
Provide a simplified interface to a complex subsystem.
Flyweight
Share fine-grained objects to minimize memory use by externalizing shared state.
Dynamic Linkage
Load modules or classes at runtime, enabling pluggable architectures.
Virtual Proxy
Act as a placeholder for an object that is expensive to create, instantiating it on demand.
Decorator
Attach additional responsibilities to an object dynamically by wrapping it.