header image
Main Menu
Home
Design Principles
Creational Patterns
Behavioral Patterns
Structural Patterns
Forum
What Design Pattern To Choose?
Design Principles and Patterns
Enterprise Patterns
Books
Login Form





Lost Password?
Syndicate
Home
| Add to del.icio.us
Mediator Pattern
Written by oodesign   
Monday, 12 November 2007

Mediator Pattern

The mediator pattern is used to takes the role of a hub or router and facilitates the communication between many classes. A similarity can be made with the database systems. The mediator transform a hard to implement relation of many to many, where each calls has to communicate with each other class, in 2 relations, easy to implement, of many to one and one to many, where the communication is handled by the mediator class.

In order to have a good object oriented design we have to create lots of classes interacting one with each other. If certain principles are not applied the final framework will end in a total mess where each object relies on many other objects in order to run. In order to avoid tight coupled frameworks, we need this mechanism to facilitate the interaction between objects in a manner in that objects are not aware of the existence of other objects.

Last Updated ( Tuesday, 19 February 2008 )
Read more...
 
Visitor Pattern
Written by oodesign   
Tuesday, 06 February 2007

Visitor Pattern


Motivation

Collections are data types widely used in object oriented programming. Often collections contain objects of different types and in those cases some operations have to be performed on all the collection elements without knowing the type.

 

A possible approach to apply a specific operation on objects of different types in a collection would be the use if blocks in conjunction with 'instanceof' for each element. This approach is not a nice one, not flexible and not object oriented at all. At this point we should think to the Open Close principle and we should remember from there that we can replace if blocks with an abstract class and each concrete class will implement its own operation.

Last Updated ( Wednesday, 02 April 2008 )
Read more...
 
Template Method Pattern
Written by oodesign   
Wednesday, 23 August 2006

Template Method


Motivation

If we take a look at the dictionary definition of a template we can see that a template is a preset format, used as a starting point for a particular application so that the format does not have to be recreated each time it is used.
Last Updated ( Wednesday, 26 March 2008 )
Read more...
 
<< Start < Prev 1 2 3 Next > End >>

Results 1 - 8 of 19
Newsflash
Latest News
Popular
Polls
Which company you hate(dislike) the most?
 
Who's Online
We have 7 guests online