Design Pattern in Simple Example1
Design Pattern in Simple Example1
Introduction
Instead of defining what is design pattern lets define what we mean by design and what we mean by
pattern. According to me design is blue print or sketch of something so it can be defined as creation of
something in mind. Moving to pattern, we can define it as guideline, or something that repeats. Now the
definition of design pattern becomes creating something in mind that repeats or in other words
capturing design ideas as a "pattern" to the problems.
Some problem patterns happen over and over again in a given context and Design Pattern provides a
core of the solution in such a way that you can use the core solution every time but implementation
should and may vary and the main reason behind that is we have the core solution and not the exact
solution. We can discuss an example here about database normalization. Normalization is a pattern
(Core solution to database design) but what level of normalization you need (exact solution) depends on
your requirement and context.
In this article I will be discussing the following Design patterns ( or common problems and there common
solutions which are time tested and have worked when applied ).
Creational Patterns
o Abstract Factory
o Builder
o Factory
o Prototype
o Singleton
Structural Patterns
o Adapter
o Bridge
o Composite
o Decorator
o Facade
o Flyweight
o Proxy
Behavioral Patterns
o Chain of Responsibility
o Command
o Interpreter
o Iterator
o Mediator
o Memento
o Observer
o State
o Strategy
o Template Method
o Visitor