Wednesday, June 12, 2013

A quick recap of design patterns:
Creational patterns:
Abstract Factory : This provides an interface for creating families of related or dependent objects without specifying their concrete classes.
Builder: Specifes the construction of a complex object from its representation so that the same process can be applied elsewhere.
Factory : Define an interface for creating an object, but lets subclasses decide which class to instantiate.
Prototype: Specify the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.
Singleton: Ensure a class only has one instance and provides a global point of access to it.
Structural Patterns:
Adapter : Convert the interface of a class into another interface clients expect/
Bridge : decouple an abstraction from its implementation so that the two can vary independently
Composite : Compose objects into tree structure to represent part-whole hierarchies.
Decorator : Attach additional responsibilities to an object dynamically.
Facade: Provide a unified interface to a set of interfaces in a subsystem
Flyweight: Use sharing to support a large number of fine-grained objects efficiently
Proxy: Provides a placeholder for another object to control access to it.
Behavioural Patterns:
Chain of responsibility: Avoid coupling the sender of a request to its receiver by giving more than one object  a chance to handle the request.
Command : Encapsulate a request as an object. so that requests can be queued, logged and support undo
Interpreter : Given a language, define a representation for its grammar and use it to interpret sentences in the language.
Iterator : Provide a way to access the elements of an aggregate object sequentially
Mediator: Define an object that encapsulates how a set of objects interact.
Memento: Without violating encapsulation, capture and externalize an objects state so that the object can be restored to that state:
Observer: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
State: Allow an object to alter its behavior when its internal state changes.
Strategy: Define a family of algorithms, encapsulate each one, and make them interchangeable
Template method: Define the skeleton of an algorithm in an operation, deferring some steps to sub classeses.
Visitor: Represent an operation to be performed on the elements of an object structure without changing the elements and defining new operations.
 

No comments:

Post a Comment