I couldnt understand following Design Patterns very well. I will appreciate if anyone explain it with real time example 1. Mediator 2. Momento
Joined: Apr 08, 2005
Its not Momento...Its Memento :-)
sankha subhra das
Joined: Jun 24, 2003
Anirudha, i'll try to make this simple...
(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.
(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.