wood burning stoves*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Design Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Design Pattern" Watch "Design Pattern" New topic
Author

Design Pattern

Anirudha Joshi
Greenhorn

Joined: Apr 08, 2005
Posts: 22
Hello,

I couldnt understand following Design Patterns very well. I will appreciate if anyone explain it with real time example
1. Mediator
2. Momento

Anirudha
Anirudha Joshi
Greenhorn

Joined: Apr 08, 2005
Posts: 22
Its not Momento...Its Memento :-)
sankha subhra das
Greenhorn

Joined: Jun 24, 2003
Posts: 22
Anirudha,
i'll try to make this simple...

Mediator :

(i) jndi works as mediator between clients that needs services and agents that publish resources/services. jndi is facilitating this by limiting
direct interaction between these two parties, so they are not very tightly coupled to each other.
(ii) Logging of a message for audit purpose is a common mediation pattern. This Mediation entails Objects to log the incoming message to a file/database table for future retrieval or audit.

Memmento :

(1) Say u got a house in new orleans but u reside in clarksburg, wv. the house is new/refurnished so u take a photograph (Memento) of the place such that it can be restored later(or for ur insurance company to pay for flood damages), if needed. You retain the photos and hand them to the local insurance agent to pay for the damage. Note that you procured and stored the Memento, but never had to look at or use its contents.

Thanks
Sankha Subhra Das
 
 
subject: Design Pattern