Dev Notes

Suspended Indefinetly...

News

<script type="text/javascript"><!-- google_ad_client = "pub-9887566656700242"; google_ad_width = 120; google_ad_height = 600; google_ad_format = "120x600_as"; google_ad_type = "text"; //2006-12-28: Savvy google_ad_channel = "6620623950"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <script type="text/javascript"><!-- google_ad_client = "pub-9887566656700242"; google_ad_width = 120; google_ad_height = 60; google_ad_format = "120x60_as_rimg"; google_cpa_choice = "CAAQxZqazgEaCMOiwb9yonQWKIHD93M"; google_ad_channel = ""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

Favourites

Friends

India MVP & CS

My Blog Roll

Publicity

Three things to avoid when using design patterns

from Terje's weblog

I found these three issues in many J2EE apps built. Design patterns used when those are not required too.

Using design patterns is a good thing, but as any other programming technique, it can easily be misused. Here‘s three things you should avoid when using design patterns:

Using evil design patterns
A few design patterns are considered evil by some. This includes one of the GoF-patterns; Singleton. Some people even call Singleton an anti-pattern,
and the use of an IoC-container is a good way to avoid being tempted to use Singletons. If you don't want to use an IoC-container Singletons can be
used (sparingly) if used wisely.

Using design patterns the wrong way
Most design patterns are well documented. Using a design pattern the wrong way leaves a pitfall in your code.
A programmer looking at the code might think a design pattern is used when it in fact is bad code disguised as a design pattern.

Overuse design patterns
A simple functionality does not need a complicated design. Overusing design patterns complicated things, and can in fact make the code harder to maintain.
An obvious rule is to only use a design pattern when it improves the design.

Comments

TrackBack said:

# October 28, 2004 10:42 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)