Monday, February 13, 2012

Design Patterns


Knowingly or unknowingly we have been applying design patterns from the early days of software development. Design patterns in simple terms can be described as trusted, optimized and reusable solutions provided for the problems encountered during the development of software. Since these patterns are tried and tested, so their proper use makes the software easy to develop and maintain. Since these patterns have evolved over time and with experience so they have emerged as trustworthy tools for our software development. It has been said that software development and its architecture is an art- if the same patterns are not used judiciously they can prove fatal for the life of your software.

            There are many literature which classifies various design patterns into various categories. Following are the categories into which we can divide various design patterns.

Structural pattern - This pattern deals with the relationship between the entities (say objects) involved in a system and their composition. Structural pattern is concerned with how classes and objects collaborate to form larger structures which comprises system. Structural pattern shows how individually developed libraries can be used to work together in an organized manner.

Creational pattern- This pattern provides a way of optimally creating objects in the system. Creational design patterns abstracts the instantiation process. They deal with encapsulating the instantiation process-meaning all the instances are created at one place in a system, in that sense creational patterns also hides the instantiation process as the client is never aware of how various instances in the system are created. Separating out this instantiation process gives us the advantage of easily adding,removing different objects of a system, moreover it makes the system loosely coupled. 

Behavioral pattern- This pattern pertains to those objects in the system which is associated through a common behavior and how they communicate among themselves.

Examples of various types of design patterns:-

Structural
Creational
Behavioral
Adapter
Abstract Factory
Chain of responsibility
Bridge
Builder
Command
Composite
Factory Method
Interpreter
Decorator
Prototype
Iterator
Fa├žade
Singleton
Observer
Flyweight

Proxy

State


Visitor





No comments:

Post a Comment