Design Patterns

Design patterns are repeating structures of design and architecture.

Another definition of Design patterns.

List of Software Design Patterns on Wikipedia. Also significant list is the one about Architectural Patterns.

Patterns

Some key patterns are listed here:

Creational Patterns

    • Abstract Factory (link) - Creates an instance of several families of classes without detailing concrete classes.
    • Builder - Separates object construction from its representation, always creates the same type of object.
    • Factory Method (link) - This makes an instance of several derived classes based on interfaced data or events.
    • Prototype - A fully initialized instance used for copying or cloning.
    • Singleton - A class with only a single instance with global access points.
    • Singleton pattern in C# (link). For more details related to Singleton pattern, search Threading on this site.

Structural Patterns

    • Adapter (link) - Match interfaces of different classes therefore classes can work together despite incompatible interfaces.
    • Bridge (link) - Separates an object's interface from its implementation so the two can vary independently.
    • Composite - A structure of simple and composite objects which makes the total object more than just the sum of its parts.
    • Decorator (link) - Dynamically add alternate processing to objects.
    • Facade (link) - A single class that hides the complexity of an entire subsystem.
    • Flyweight - A fine-grained instance used for efficient sharing of information that is contained elsewhere.
    • Proxy - A place holder object representing the true object.

Behavioral Patterns

    • Chain of Responsibility - A way of passing a request between a chain of objects to find the object that can handle the request.
    • Command - Encapsulate a command request as an object to enable, logging and/or queuing of requests, and provides error-handling for unhandled requests.
    • Interpreter - A way to include language elements in an application to match the grammer of the intended language.
    • Iterator - Sequentially access the elements of a collection without knowing the inner workings of the collection.
    • Mediator - Defines simplified communication between classes to prevent a group of classes from referring explicitly to each other.
    • Memento - Capture an object's internal state to be able to restore it later.
    • Observer (link) - A way of notifying change to a number of classes to ensure consistency between the classes.
    • State - Alter an object's behavior when its state changes.
    • Strategy (link) - Encapsulates an algorithm inside a class separating the selection from the implementation.
    • Template Method - Creates the shell of an algorithm in a method, then defer the exact steps to a subclass.
    • Visitor - Adds a new operation to a class without changing the class

References and Links

    • Catalog of Patterns of Enterprise Application Architecture (Martin Fowler, link)
    • .NET Design Patterns - GOF, (link), dofactory
    • Design Patterns Library (link)
    • Software Architecture & Design Patterns (link)
    • Strategy pattern, and others @dofactory (link)
    • Design Patterns @sourcemaking (link)

To see JavaScript patterns, go to JavaScript page.

Links:

    • ASP.NET patterns every developer should know (link)