What are the Design Patterns you know.
By in Design Patterns & Practices on Jan 11 2007
  • Sep, 2007 24

    Creational Pattern deals with the best possible way of creating an object or an instance of a class.They simplify object creation and provide a flexible approach towards object creation.The following are the sub-patterns that fall under this group.
    The Abstract Factory pattern uses objects to manage object creation. The Abstract Factory pattern provides an interface for creation of a family of related objects, but without specifying their concrete classes. 
    The Factory pattern is using inheritance to manage object creation.The Factory pattern also provides an interface for the creation of objects, but allows the inherited classes to decide on the appropriate time of these instantiations.
    The Builder pattern is one that isolates the construction of a complex object from its representation, thus ensuring that several different representations can be created depending on the requirements.
    The Prototype pattern allows an initialized and instantiated class to be copied or cloned to create new instances rather than creating new instances.
    The Singleton pattern indicates that there can be only one instance of a class throughout the Application’s life cycle.  A singleton class is one that can be instantiated only once in the application domain and provides a global point of access to it.

    Structural Patterns provides the flexibility to specify how objects and classes can interoperate.The following are the sub patterns that comprise the Structural Patterns group.
    The Adapter Pattern allows different classes to inter-operate even with incompatible interfaces.
    The Facade Pattern depicts a single class that represents a high level class in an entire subsystem and makes the subsystem easier to use.  As an example, a Façade design pattern ensures that we can have a class that can act as a layer between the User Interface Layer and the Business Service Layer.  Thus, it acts as an agent in the sense that it facilitates the communication between the User Interface Layer and the Business Service Layer in a typical n–tier application design.  It is to be noted here that both the Adapter and Façade design patterns can be used to change the interfaces of the classes, thus enabling an easier communication of these classes from the User Interface Layer. 
    The Bridge Pattern eliminates the need of adapter classes in a sub system and decouples an object’s interface from its implementation so that both can work independent of each other. 
    The Composite Pattern is a design pattern that is used to compose a tree like structure of simple and composite objects so that the clients can treat the individual objects and their compositions in a uniform manner.
    The Decorator Pattern provides an alternative for sub classing to extend functionality in a sub system and adds responsibilities to objects even after construction of the design of the system. 
    The Flyweight Pattern is a fine-grained instance used for efficient sharing. 
    The Proxy Pattern shows an object representing another object and, like the Adapter Design Pattern, it acts as a layer between the client or the consumer application and the actual object.

    Behavioural Patterns help you define a structure for inter-object communication between objects in your system.  This design pattern is typically used to monitor the messages that are transmitted when the objects communicate in a system.  The following are the sub patterns under Behavioral Patterns.
    The Chain of Responsibility Pattern is one that details a way of passing a request between a chain of objects. 
    The Command Pattern encapsulates a command request as an object. 
    The Interpreter Pattern is a way to include language elements in a program. 
    The Iterator Pattern sequentially accesses the elements of a collection. 
    The Mediator Pattern defines simplified communication between classes. 
    The Memento Pattern captures and restores an object's internal state. 
    The Observer Pattern is a design pattern that provides a way of notifying a change to a number of its dependant classes.  Therefore, when one object changes its state, so do all its dependant objects in the sub system. 
    The State Pattern is a design pattern that changes an object's behavior when the internal state of the object changes. 
    The Strategy Pattern is used to encapsulate a family of algorithms inside a class and use them interchangeably and independent of the client application that use the same. 
    The Template Method Pattern is a design pattern that is used to provide a template of an algorithm and defers some of the steps of the algorithm to the subclasses. 
    The Visitor Pattern is one that is used to define a new operation to a class without a change.


    • 0
  • V J
    Sep, 2007 6

    Creational

    Structural

    Behavioral

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS