28 September 2012

Software Design Pattern

Introduction:
· A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design.
· Design patterns are recurring solutions to software design problems.
· Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.
Use of Design Pattern:A design pattern helps you to find tested proven design paradigm to build a solid foundation for your project. So, if you follow design pattern you can easily prevent major issues to come while building your actual project. Moreover design pattern also helps the other architects to understand your code easily.
History of Design Pattern: Types of Design Pattern:· Creational patterns.
· Structural patterns.
· Behavioral patterns.
· Concurrency patterns.
Now, I am going to discuss few examples of patterns. They are
· Singleton Design Pattern.
· Factory Design Pattern.
· Factory Method Design Pattern.
· Abstract Factory Design Pattern.
· Builder Design Pattern.
· Adapter Design Pattern.
· Bridge Design Pattern.
· Composite Design Pattern.
· Flyweight Design Pattern. Singleton Design Pattern
Singleton pattern creates a class which can have a single object throughout the application,
Factory Pattern:A Factory is actually a creator of object which has common interface.
Factory Method Design Pattern:It creates the object of the class through interfaces but on the other hand, it also lets the subclass to decide which class to be instantiated.
Abstract Factory Design Pattern:It provides Factory interfaces for creating a family of related classes.
Builder Design Pattern:This pattern creates object based on the Interface, but also lets the subclass decide which class to instantiate.
Adapter Design Pattern:Adapter pattern actually makes two classes compatible.
Bridge Design Pattern:Bridge pattern compose objects in tree structure. It decouples abstraction from implementation.
Composite Design Pattern:Composite pattern treats components as a composition of one or more elements.
Flyweight Design Pattern:Flyweight allows you to share bulky data which are common to each object.

No comments: