Wiki - Design Patterns
Object Oriented Programming
Model that organizes software design around data, or objects, rather than functions and logic. OOP allows objects to interact with each other using four basic principles: encapsulation, inheritance, polymorphism, and abstraction.
Creational patterns
Abstract Factory
Builder
Dependency Injection
Factory Method
Object Pool
Prototype
Singleton
Provide an interface to create an instance of several families of classes.
Builder
Separates object construction from its representation.
Dependency Injection
A class accepts the objects it requires from an injector instead of creating the objects directly.
Factory Method
Creates an instance based on interface of several derived classes.
Object Pool
Avoid expensive acquisition and release of resources by recycling objects that are no longer in use.
Prototype
A fully initialized instance to be copied or cloned.
Singleton
A class of which only a single instance can exist.
Structural patterns
Adapter
Bridge
Composite
Decorator
Delegation
Facade
Flyweight
Module
Private Class Data
Proxy
Match interfaces of different classes by converting the interface of a class into another expected interface.
Bridge
Separates the interface of an object from its implementation.
Composite
A tree structure of simple and composite objects.
Decorator
Add responsibilities to objects dynamically and provide a flexible alternative to subclassing for extending functionality.
Delegation
Extend a class by composition instead of subclassing and handle a request by delegating to a second delegate object.
Facade
A single class unified interface that represents an entire subsystem and defines a higher-level interface that makes the subsystem easier to use.
Flyweight
A fine-grained instance used for efficient sharing and support large numbers of similar objects.
Module
Group several related data constants and elements as classes, singletons, global methods, into a single conceptual entity.
Private Class Data
Restricts accessor/mutator access.
Proxy
An object representing another object by placeholder to control the access.
Behavioral patterns
Chain of responsibility
Command
Interpreter
Iterator
Mediator
Memento
Null Object
Observer
State
Strategy
Template method
Visitor
A way of passing a request between a chain of objects.
Command
Encapsulate a command request as an object allowing parameterization, queuing, logging.
Interpreter
Include language elements in a program based on defined representation.
Iterator
Sequentially access the elements of a collection.
Mediator
Defines simplified communication between classes and their interaction.
Memento
Capture and restore the internal state of an object.
Null Object
Designed to act as a default value of an object.
Observer
Automatically notify about changes, updates and events to an array of classes and subscribers.
State
Alter the behavior of an object when its state changes.
Strategy
Encapsulates an algorithm inside a class.
Template method
Defer the exact steps of an algorithm to a subclass.
Visitor
Defines a new operation to a class without change.
Concurrency patterns
Active Object
Balking
Binding properties
Guarded suspension
Join
Lock
Messaging
Monitor object
Reactor
Read-write lock
Scheduler
Service handler
Thread pool
Thread-specific storage
Decouples method execution from method invocation in multi-threaded applications.
Balking
Only execute an action on an object when the object is in a particular state or prevent that object to execute a state.
Binding properties
Combining multiple observers to force properties in different objects.
Guarded suspension
Manages operations that require both a lock to be acquired and a precondition to be satisfied before the operation can be executed.
Join
Provides a way to write concurrent, parallel and distributed programs by message passing.
Lock
One thread puts a lock on a resource, preventing other threads from accessing or modifying it.
Messaging
Allows the interchange of information between components and applications.
Monitor object
An object whose methods are subject to mutual exclusion and enforce single-threaded access to data. Only one thread at a time is allowed to execute code within the monitor object.
Reactor
A reactor object provides an asynchronous interface to resources that must be handled synchronously.
Read-write lock
Allows concurrent read access to an object and requires exclusive access for write operations.
Scheduler
Explicitly control the execution of single-threaded code.
Service handler
For each request, a server spawns a dedicated client handler to handle a request.
Thread pool
A number of threads are created to perform a number of tasks and organizes them in a queue.
Thread-specific storage
Static or global memory object mechanism to a thread.
Download
White Metropolitan Documents