This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
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 Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Design Pattern" Watch "Design Pattern" New topic

Design Pattern

Anirudha Joshi

Joined: Apr 08, 2005
Posts: 22

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

Anirudha Joshi

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

Joined: Jun 24, 2003
Posts: 22
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.

Sankha Subhra Das
It is sorta covered in the JavaRanch Style Guide.
subject: Design Pattern
It's not a secret anymore!