Design Patterns in VB.NET
page 1 of 4
Published: 10 Jul 2006
Unedited - Community Contributed
This article looks at what are GoF design patterns and how they fit. It mentions who the GoF are and how they came to work on the design patterns. It also deals with the parts of a pattern and the O-O design principles which underwrite them. Finally, it examines the advantages of using design patterns and why you should use them to code every day.
by David Simmonds
Average Rating: 
Views (Total / Last 10 Days): 48888/ 58

What are GoF Design Patterns

Design patterns represent repeatable solutions to common problems found in designing object oriented systems.  They represent optimal (though not perfect) ways of arranging classes and objects together and assigning to each class responsibility for instantiating, interacting with, composing other classes and passing messages to each other in order to solve a particular problem faced by developers.  Consider a radiator, such as is found in a car.  You might ignore it for a long time, but if you have a “vintage” automobile, then driving on a hot day in bumper-to-bumper traffic (a radiator’s worst nightmare) you might notice your windshield getting an unscheduled “steam-bath.”  So, you call your favourite mechanic and you get the car to his garage.  Then, having a lot of time on your hands, you finally pay some attention to the unassuming, but very vital piece of equipment that thanklessly cools your car engine day by day.

The radiator is a vital component in your car and is composed of parts which interact to achieve the cooling of your car’s engine.  In the same way, a design pattern represents an arrangement of classes with an assignment of responsibility to each, which represents the way to solve a particular problem. This arrangement is easily recognizable to the initiated and is easily reproducible in other situations.  It is also easy to extend and maintain the pattern by those who understand its inner workings.  Every self-respecting mathematician understands that math problems have patterns which comprise participants that collaborate (quadratic equations have cubes and squares that are solved by factoring, simultaneous equations have two equations, each with two instances of the variables to solve for and geometry problems have lines and angles and are solved with cosines, sines and tangents). The goal of this tutorial is to have every single O-O programmer in the world be initiated into the structure and workings of design-patterns.


Origin of Design Patterns

There are hundreds of design patterns that are broken down broadly into design patterns, concurrency patterns, transactional patterns, web patterns and other categories.  So design patterns are by no means the only category of patterns.  No one is saying that the Gang of Four (GoF) have cornered the pattern market.  For that matter, it should be pointed out that the GoF did not even create these patterns.  They largely existed in O-O systems before.

In 1994, four guys, now all PhDs: Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides (who died of cancer November 24, 2005) came together in order to write a book that was built on Erich’s PhD thesis.  It was published as “Design Patterns, Elements of Reusable Object-Oriented Software” (Addison-Wesley, ISBN 0-201-63361-2).  On the way to being published, it was presented to several O-O conferences and eventually in book form became known as the “bible” of patterns.  The software development community also affectionately nicknamed these four pioneers the “Gang of Four” or GoF (folks concerned about misguided religious fervor should note the common “o”).  So we have a “Gang” which is responsible for a “bible.”

The GoF patterns represent the core of design patterns.  When you study them and look at other patterns, you see tremendous similarities which make you suspect that you could get by with focusing on the 23 they described.  They might have tweaked them a bit to improve their robustness, but they were pre-existing and the GOF simply documented them.  In fact, a requirement for a pattern being documented was that it already existed in several applications.  What the GoF actually contributed was their methodology for cataloging them, which is impeccable and introduced the well needed thought process required to mull over, digest and ruminate on design patterns in order to make them a part of your vocabulary and incorporate them as the centerpieces of your design efforts.

So the GoF simply did for design patterns what the Bauxite companies did for Aluminum. The Bauxite companies did not make Alumina, but they engineered ways to find it, unearth it, process it, purify it and turn it into Aluminum - a metal that the GoF would have appreciated on (I assume) their trips across continents, since it is used in the instantiation of the structures of Airplanes and Cars due to its lightweight coupled with its tendency to behave very robustly under pressure.  The unfortunate thing is that scientists are usually poor businessmen (literally) and usually lack branding and marketing skills.  I ask myself what the difference between CISCO and what GoF Patterns could have been or still could be?  The answer I come up with is nothing.  In fact, let me be (one of?) the first to predict that there will be GoF certification in the future.  GoF centers will be all over the world, complete with logo and quarterly results.  I know PhD's abhor money.  But after all, the Bauxite companies did not create bauxite either.  And believe me, in Jamaica, when you work for a bauxite company, you do not exactly beg for a living.

As for the other design patterns and other categories of patterns, if you are interested in the hundreds that exist then do not stop here, you are welcome to go explore.  Me, I specialize in GoF.


View Entire Article

User Comments

Title: Code samples   
Name: Mike Angelastro
Date: 2008-05-12 10:13:13 AM
Title: How do design patterns fit with SOD/SOP   
Name: Mike Angelastro
Date: 2008-05-12 10:10:30 AM

Name: David M. Simmonds
Date: 2007-05-21 3:26:11 PM

Title: Response to Estevez   
Name: David M. Simmonds
Date: 2007-05-21 2:04:47 PM
In response to Estevez:
"I think Design Patterns are an philosofic part
of programming, can't see any worth of using it."


Title: Art of programming   
Name: Estevez
Date: 2007-05-18 5:11:20 PM
Title: nice Analogy   
Name: Amos
Date: 2007-05-10 6:05:32 PM
Title: Perfect WHY article   
Name: Vin
Date: 2007-04-13 3:58:52 PM
Title: Easy to Read   
Name: Mayank
Date: 2007-02-16 11:46:26 AM
Title: Look forward to more in the future   
Name: Ben
Date: 2007-01-29 6:41:04 PM
Title: Fantastic :)   
Name: Kris
Date: 2007-01-26 7:40:12 AM
Very elegantly described and introduced to design patterns.
Title: So cool   
Name: Luis Vega
Date: 2007-01-23 5:19:38 PM
Excellent Article, I want to read more.
Title: Good Analogies   
Name: Ali
Date: 2007-01-18 5:01:33 AM
Title: Solar System   
Name: Miri Davidian
Date: 2007-01-15 9:17:29 AM
Dear Sir,

I have a question.
I would be grateful if you would help me.
What would be the design patterns solution for solar system?
The Sun, is obviously singleton.
The plans are obviously factory.
But, when it becomes to the stars,
I wonder what they are.
On one hand, the stars are factory for the sun;
So, what are they?

Many thank in advance,
Title: very good   
Name: Rushikesh K Khairnar
Date: 2007-01-07 1:35:09 PM
Simple and informative
Title: Nifty   
Name: Denny Jacob
Date: 2006-12-27 3:48:46 PM
Title: Very Good   
Name: Pandi
Date: 2006-12-26 12:01:56 PM
Title: many thanks   
Name: Monica
Date: 2006-12-18 11:58:07 AM
clear view of how design patterns came to light!
Title: Tanks   
Name: Shaik Kaleelur Rahman
Date: 2006-12-18 5:32:27 AM
Very Nice Article
Title: Well Done - Three Cheers   
Name: Rajeev Gopalakrishnan
Date: 2006-12-12 4:10:56 PM
Title: cool   
Name: shubha N
Date: 2006-09-11 5:44:18 AM
this artical is very informative
Title: very informative   
Name: gowri shankar
Date: 2006-09-11 5:42:53 AM
it was very informative good work
Title: Nice   
Name: Veeru
Date: 2006-08-25 8:58:23 AM
Title: KISS   
Name: George
Date: 2006-07-27 11:34:53 AM
Title: Plain and Informative   
Name: Mehdi Anis
Date: 2006-07-21 3:51:23 PM
Title: Cool   
Name: Ed
Date: 2006-07-18 7:48:51 AM
Great Article. Very useful. Wonderful job
Title: Cool   
Name: Ed
Date: 2006-07-14 6:03:56 PM
Great Article. Very useful. Wonderful job!!!

Product Spotlight
Product Spotlight 


©Copyright 1998-2017  |  Page Processed at 2017-01-24 12:14:51 PM  AspAlliance Recent Articles RSS Feed