• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it neccessary to have Mediator Singleton

 
Ranch Hand
Posts: 58
Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I would like to know "Is it the case that Mediator should be singleton??"


Thanks in Advance,
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not at all.

A mediator is just a way of decoupling the objects in a group or collection from the the objects which manipulate them. It's quite feasible for an application to contain many mediator classes, and each class to be instantiated many times.

In the "Gang of Four" book ("Design Paterns", Gamma et al.) Mediator is discussed in the context of a dialog for selecting fonts. There is no reason for this or any other mediator to be a Singleton.

Why do you ask? Have you found a situation where you think a Mediator should be a Singleton?
reply
    Bookmark Topic Watch Topic
  • New Topic