title: Sending a message between 2 objects
body: <p>I have objects A and B that need to send and receive messages from each other.</p>
  
  <p>For example:</p>
  
  <p>I click, this causes A to send a message to B. B does something with it then sends A another message as a reply.</p>
  
  <p>Right now the way I have it is,
  A has a B* and B has an A* and they call each other's sendMessageTo method to communicate.</p>
  
  <p>Is there a better way to do this sort of thing?</p>
  
  <p>Basically, the server sends a message or the local game sends a message which a polymorphic mediator takes in. The mediator either gets the message from the server or local game. The mediator passes it on to the client which does whatever with it. The idea is that the mediator should not be doing logic for the client hence message passing.</p>