Home > cakePhp, php, ruby on rail, Software Engineering, Web, wordpress > What are design patterns.

What are design patterns.

In simplest way we can say “Software Engineering best practices for common software Problems”.  A design pattern is a proven design solution to a common problem faced by software developers. Design patterns became popular with the rise of object oriented analysis and design (OOAD).

But most widely used definition for “Design Patterns” is as follows.

“In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn’t a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.”

Applying software engineering design pattern not only speedup the development as well as prevent certain subtle issues that can cause some major problems and issues.

It  improve the readability of code to developers and architects as well as allow better communication due to some standard well known, well understood names for software interactions.

These software design patterns can be be improved over time, making them more robust than ad-hoc designs.

Classification of Design Patterns:

Design patterns are classified into three categories:

1.    Creational Patterns

2.    Structural Patterns

3.    Behavioral Patterns

There is another classification introduced for software architecture level named as

Architecture Patterns: most commonly known pattern is MVC.

Creational design patterns

This design patterns is all about class instantiation. This pattern can be further divided into class-creation patterns and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.

Abstract Factory: Creates an instance of several families of classes

Builder: Separates object construction from its representation

Factory Method: Creates an instance of several derived classes

Object Pool: Avoid expensive acquisition and release of resources by recycling objects that are no longer in use

Prototype: A fully initialized instance to be copied or cloned

Singleton: A class of which only a single instance can exist

Structural design patterns

This design patterns is all about Class and Object composition. Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.

Adapter: Match interfaces of different classes

Bridge: Separates an object’s interface from its implementation

Composite: A tree structure of simple and composite objects

Decorator: Add responsibilities to objects dynamically

Façade: A single class that represents an entire subsystem

Flyweight: A fine-grained instance used for efficient sharing

Private Class Data: Restricts accessor/mutator access

Proxy: An object representing another object

Behavioral design patterns

This design patterns is all about Class’s objects communication. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

Chain of responsibility: A way of passing a request between a chain of objects

Command: Encapsulate a command request as an object

Interpreter: A way to include language elements in a program.

Iterator: Sequentially access the elements of a collection

Mediator: Defines simplified communication between classes

Memento: Capture and restore an object’s internal state

Null Object: Designed to act as a default value of an object

Observer: A way of notifying change to a number of classes

State: Alter an object’s behavior when its state changes

Strategy: Encapsulates an algorithm inside a class

Template method: Defer the exact steps of an algorithm to a subclass

Visitor: Defines a new operation to a class without change

Note: thanks for the http://sourcemaking.com/design_patterns but i m thinking to elaborate these patterns in detials.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: