Design Patterns in VB.NET
page 4 of 4
by David Simmonds
Feedback
Average Rating: 
Views (Total / Last 10 Days): 59083/ 57

Advantages of Design Patterns

Design patterns allow for extensibility in the O-O design, so that particular functionalities can be enhanced, debugged, modified, made secure or performance-tuned without breaking the rest of the surrounding code.  You can apply code access security to one object, while applying role based security to another; so if you have 3 security experts, you could split up their work on that basis.

They allow for a need-to-know approach to development (I bet they use them a lot at the CIA).  Suppose you have a secret routine with a lot of industry-intelligence in it and your company’s survival depends on it.  If a new programmer joins your company and has not yet earned a high level of trust, do you expose the new-programmer to the inner guts of the weather-prediction code or do you have him instantiate classes by an object-factory which is accessible only to your lead developers?  Creational patterns help you to implement solutions to this dilemma.

Design patterns also allow you to separate the Object-Model from the Operations which must be carried out on the structure representing the Object Model.  The Trinity of Composite, Iterator and Visitor patterns help you to achieve this.  Interpreter and Composite patterns also help to accomplish this by separating the grammar which describes a language from the algorithms that figure out the meaning of sequences of words in that language.  You can actually overhaul Object-Models extensively without touching a line of code which traverses and evaluates it!

Design patterns allow you to extend the functionality of classes defined in class libraries from third party developers, even if they are scoped in a way so as to disallow extension.  Supposing a function in a class library is marked as “not override ready,” you can still extend the operations by using the decorator or adapter patterns.  Obviously, you should be careful about the extension in these circumstances since the manufacturer must have had reasons for not allowing you to easily extend the functionality.

Without using design patterns, classes will multiply within your code in order to represent every possible combination of behaviors.  Either that or you will put in so many if-then-else case statements that you will choke on them the first time you try to unravel them.

Why should your clients, boss or customers care if you use design patterns?  Well it will help you to avoid the conundrum that is facing the automobile industry right now.  There is a need to move toward renewable sources of energy and so solar powered cars must take prominence in the future.  The problem lies in that trillions of dollars is invested in the current infrastructure which produces gas-powered cars.  The new technology is incompatible with the old and the introduction of the new will mean throwing out the old. This is what happens with badly designed software.  In order to introduce new changes you have to discard what exists since it is not extensible enough to permit changes that the client requires.  Design patterns help you to avoid this problem.

Design patterns also represent the natural boundaries for subsystems when designing and testing, since the sum of parts should interact in a predictable and interface-able manner.

It represents a predictable way of maintaining systems.  The very expensive nature of cars dictates that they be built on similar platforms for cost savings and also that they be maintainable based on a engineered similarity – 4 wheels, a steering wheel, front-end, water pump, ignition systems – that all follow a common model.  A mechanic who has never worked on a particular brand of car before is still able to perform many of the fixes on it because he knows what the general arrangement of parts will look like and what tends to cause the problems.  A Toyota specialist, once he understands the design patterns of a Toyota, can look at a fairly new model from Toyota and fix it.  Software must become like this.

Security can also be improved with the use of design patterns since the layer which interacts with databases can be abstracted out of the reach of the user-programmer who then has no need to dig around in the database to do their GUI work.

Conclusion

Design patterns are repeatable solutions to the problems faced my programmers today who work in object-oriented systems.  The more you know about them the more I know you will want to learn more. They offer endless possibilities to the computer world.

 

 

 

 

 


View Entire Article

User Comments

Title: Code samples   
Name: Mike Angelastro
Date: 5/12/2008 10:13:13 AM
Comment:
What is a good source of VB .NET code samples for the design patterns?
Title: How do design patterns fit with SOD/SOP   
Name: Mike Angelastro
Date: 5/12/2008 10:10:30 AM
Comment:
How do design patterns fit with Service Oriented Design/Service Oriented Programming? The underlying principles are similar.

Another metaphor is a schematic diagram of an electronic circuit or logic circuitry. These explain how item is put together.
Title: Response to Estevez - Part II : Philosophy of Design Patterns   
Name: David M. Simmonds
Date: 5/21/2007 3:26:11 PM
Comment:
On the other hand, design patterns do have a very philosophical basis. The philosophy which applies to design patterns (and undergirds many religions) is that if you delay gratification (in this case the implementation of the software) and put more work into the design upfront, then you reap less pain overall and in the long run (maintaining one aspect of the system does not mess up other parts of the system). Modifications can be done painlessly and cheaply without testing every other feature in the software. Hence programmers would be involved in less "software crises".

Anyway, watch for the day when the due diligence (which is done leading up to a corporate merger/buyout) includes a software design review which determines whether the mergee has software built using design patterns. At that point, you are going to see just how tightly intertwined philosophical issues and Dollar issues can be.
Title: Response to Estevez   
Name: David M. Simmonds
Date: 5/21/2007 2:04:47 PM
Comment:
In response to Estevez:
"I think Design Patterns are an philosofic part
of programming, can't see any worth of using it."

My response is, TRUE !!! Especially if you work in your IT department's Pre-Requirements-Change unit (the Software-Development counterpart of the Pre-Crimes unit as portrayed in "Minority Report")

In other words, if you are a precog and you can read the user's minds from the day you collect User Requirements in order to do your Software Specifications, then you will never need to modify functionality in your software or add features to it. So you are right, why spend all of that effort designing the software to make it easy to extend or modify when it never needs to be modified or extended?
Title: Art of programming   
Name: Estevez
Date: 5/18/2007 5:11:20 PM
Comment:
I think Design Patterns are an philosofic part of programming, can't see any worth of using it.
Title: nice Analogy   
Name: Amos
Date: 5/10/2007 6:05:32 PM
Comment:
The way to use a car and car industry to illustrate patterns and software kick-ass.
Title: Perfect WHY article   
Name: Vin
Date: 4/13/2007 3:58:52 PM
Comment:
Everyone will be motivated to learn about design patterns after reading this article
Title: Easy to Read   
Name: Mayank
Date: 2/16/2007 11:46:26 AM
Comment:
The article is very well written & informative. It deals with a complex subject in a very lucid manner. Expect more such great articles in future.
Title: Look forward to more in the future   
Name: Ben
Date: 1/29/2007 6:41:04 PM
Comment:
Great article, I enjoyed it very much. Hopefully there will be follow-up articles with even more detail!
Title: Fantastic :)   
Name: Kris
Date: 1/26/2007 7:40:12 AM
Comment:
Very elegantly described and introduced to design patterns.
Probably also listing what excatly are 23 patterns defined, would make this article more informative
Title: So cool   
Name: Luis Vega
Date: 1/23/2007 5:19:38 PM
Comment:
Excellent Article, I want to read more.
Congratullations
Title: Good Analogies   
Name: Ali
Date: 1/18/2007 5:01:33 AM
Comment:
Great article! Very very nice real world examples. I am expecting great articles regarding this article in future.
Title: Solar System   
Name: Miri Davidian
Date: 1/15/2007 9:17:29 AM
Comment:
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;
on the other hand each is a singleton for his own plans.
So, what are they?

Many thank in advance,
Miri
miridavidian@gmail.com
Title: very good   
Name: Rushikesh K Khairnar
Date: 1/7/2007 1:35:09 PM
Comment:
Simple and informative
Title: Nifty   
Name: Denny Jacob
Date: 12/27/2006 3:48:46 PM
Comment:
Simple, flowing and not one wasted word. I wish more of us had this pattern of writing!!!!
Title: Very Good   
Name: Pandi
Date: 12/26/2006 12:01:56 PM
Comment:
It was very good to a new person who wants to know about Design patterns.
Title: many thanks   
Name: Monica
Date: 12/18/2006 11:58:07 AM
Comment:
clear view of how design patterns came to light!
Title: Tanks   
Name: Shaik Kaleelur Rahman
Date: 12/18/2006 5:32:27 AM
Comment:
Very Nice Article
Title: Well Done - Three Cheers   
Name: Rajeev Gopalakrishnan
Date: 12/12/2006 4:10:56 PM
Comment:
Wonderful, my friend, wonderful! I can't say that any more louder!!
Title: cool   
Name: shubha N
Date: 9/11/2006 5:44:18 AM
Comment:
this artical is very informative
Title: very informative   
Name: gowri shankar
Date: 9/11/2006 5:42:53 AM
Comment:
it was very informative good work
Title: Nice   
Name: Veeru
Date: 8/25/2006 8:58:23 AM
Comment:
This very nice,very useful to every one,and this is a wonderful job......
Title: KISS   
Name: George
Date: 7/27/2006 11:34:53 AM
Comment:
Keeping it Simple and Straight. A very refreshing article, waiting to see more of this... Great job
Title: Plain and Informative   
Name: Mehdi Anis
Date: 7/21/2006 3:51:23 PM
Comment:
I enjoyed reading this article. nicely written delivering good information. Thanks.
Title: Cool   
Name: Ed
Date: 7/18/2006 7:48:51 AM
Comment:
Great Article. Very useful. Wonderful job
Title: Cool   
Name: Ed
Date: 7/14/2006 6:03:56 PM
Comment:
Great Article. Very useful. Wonderful job!!!

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2014 ASPAlliance.com  |  Page Processed at 4/23/2014 4:14:13 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search