title: Java - Observer/Observable in a distributed application?
body: <p>I want to implement the observer pattern in a distributed application.
  i.e. something happens with the database in a instance of an application, and a notification should be sent to the other instance, through a socket, such that the second one will reload the data from the db. 
  Should i use:</p>
  
  <p>a) the observer/observable classes from java</p>
  
  <p>b) an event-based approach, something like, adding an Event listener when pressing a button and then send the notification through a socket</p>
  
  <p>c)any other ideas/options</p>
  
  <p>I would like to know which is the most optimal approach</p>
  
  <p>P.S. I'm working at a swing application which connects to a MySQL db. Everything is on localhost (is not for production purposes).</p>