title: Architecture: Notification mechanism
body: <p>I am just considering several architectural options for a standard software systems. Perhaps you'd like to share your opinions. </p>
  
  <p>System: 
  We have a business logic component with an underlying database. Until today this logic component was used only by one client and thus UI and Logic and Data layer all have been in one executable. (Tool A)</p>
  
  <p>Now, the program has such cool features that another, already existing tool should use it (Tool B). Tool B shall also use (or at least display) some of the data of Tool A but it also keeps its own data storage. Our solution approach is simple: 
  We split Tool A. The business logic gets a service interface (probably web services, RESTful or not). Then tool B can access the business logic of Tool A, get data, execute calculations, whatever. </p>
  
  <p>Now, if Tool B shows data of Tool A, it would be nice if it would be notified of data changes in Tool A. Our service interface is nice but a one-way story (if you don't do tricks like keeping asynchronous calls open until an event occurs). </p>
  
  <p>We see several options: </p>
  
  <ul>
  <li><p>a. Tool B also gets a service interface. When it fires up it registers with Tool A and Tool A will send change events to Tool B. </p></li>
  <li><p>b. Tool B is polling the service of Tool A for changes. </p></li>
  <li><p>c. We introduce a middleware where Tool A is publishing events and all clients may subscribe to those events. </p></li>
  </ul>
  
  <p>We don't like b). Too slow and Tool A would need a means to determine the changes for each client. 
  c) has the overhead of introducing a new component. 
  a) Will tightly couple the two tools. </p>
  
  <p>Further information:
  We will have a central datastorage (+ our business logic component) on one machine. On other machines may be the clients (up to 20, let's say. Not 100, not 1000, not 10000). 
  It is a system from one vendor. We don't have to be prepared for lots of third party tools who want to use the events (that would be a strong indicator for solution c)). </p>
  
  <p>Questions:
  i) What other options than a)-c) do we have?
  ii) Which way would you go and why? </p>