Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Design Pattern

 
Anirudha Joshi
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not Momento...Its Memento :-)
 
sankha subhra das
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic