Friday, 9 March 2012

16

5 March - 9 March 2012

Design and Implementation

Intercom is composed of a handful of templates, at the core of which are MessageObserver and Notifier.  In addition to the core templates, MessageMap provides a concrete implementation of Observer, andMessageSource provides a specialization of Notifier more consistent with the Gamma, et. al. definition of 'Subject'.  Each of templates is parameterized on at least the message type and can be specified at compile-time.  I've used typedefs everywhere possible which should make it easy to substitute alternate implementations.  

The core of Intercom is made up of a set of loosely coupled parameterized classes (templates) 
In Intercom, the type of the subject is left undefined and in fact must be specified as a template parameter.  Any type for which std::less<> may be defined is acceptable as a subject, though it will be likely in practice to use a pointer to an existing type from the data model.  To support this model, Intercom assigns the responsibility of taking registrations and distributing messages to a third-party Notifier.