A pattern general describes a problem,
which occurs over and over again in a
context and provides a generic solution to
the problem that can be reused. Let us
consider a context, a waiting place where
you wait for some service i.e., a railway
station, an airport, a hospital etc. Here the
typical problem you face is how to spend
the waiting time positively while waiting
for the desired service. You see people
reading newspaper, watching TV, starring
at each other or doing some other things.
So, a typical solution is to fuse the waiting
place with some activity that keeps people
spend the waiting time happily. Similarly, in
software development we encounter design
situations several times and we apply generic
designs to these situations. Software design patterns represent a small set of the patterns
we see in the world around us.
A design pattern is an abstraction of a software solution that can be reused in
development process whenever we encounter the context it addresses. From an object
oriented programming perspective a pattern provides a set of specific interactions that
can be applied to generic objects to solve a known problem. A design pattern is a
catalogued solution that has been applied in more than one situation to produce welldesigned
reusable object oriented software. It is the way a software developer would
solve a particular design problem. Learning individual design pattern is therefore a
better alternative to the bad design.
Pattern Example: The MVC Pattern
Model-View-Controller (MVC) is a widely used software design pattern that was
created by Xerox PARC for Smalltalk-80 in the 1980s. More recently, it has become
the recommended model for Sun’s J2EE platform, and it is gaining increasing popularity among developers. The MVC pattern is a useful one, no matter what language you
choose. The objective of the MVC pattern is the separation of components into three
types: Model, View, and Controller. |