03 May 2011

Design Patterns [Simple Definitions]

Abstract factory pattern

The abstract factory pattern is a software design pattern that provides a way to encapsulate a group of individual factories that have a common theme. In normal usage, the client software creates a concrete implementation of the abstract factory and then uses the generic interfaces to create the concrete objects that are part of the theme. The client does not know (or care) which concrete objects it gets from each of these internal factories since it uses only the generic interfaces of their products. This pattern separates the details of implementation of a set of objects from their general usage


It is used to keep the construction of object separate from its representation. Crystal report is one of the best example of Builder design pattern.
We (Client) construct a report according to our business requirement by using Crystal report's provided interface (Director).
Crystal Report represents that report independently in any available formats.

Adapter or Wrapper

It translates one interface for a class into a compatible interface e.g. Interop classes (Adapter), for using COM and Native DLLs in .Net.

Bridge Pattern

It is used to decouple an abstraction from its implementation so that the two can vary independently.
Suppose we have SQL Server's and Oracle's data connections in our Data Access Layer, and we have number of Business Objects in our Business Layer like Customer, Order etc. These Business Objects can use any data connection from the Data Access layer. So we can define new business objects without any dependency on Data Access Layer, similarly we can define MySQL data connection in our Data Access Layer without any dependency on Business Objects.

Composite Pattern

It is used to compose an object into tree structure.

Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

0 comments: on "Design Patterns [Simple Definitions]"

Post a Comment