File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: Design Pattern
It's not a secret anymore!