title: Communication between programs in .NET
body: <p>I want to separate modules of my program to communicate with each other. They could be on the same computer, but possibly on different ones.</p>
  
  <p>I was considering 2 methods:</p>
  
  <ol>
  <li>create a class with all details. Send it of to the communication layer. This one serializes it, sends it, the other side deserializes it back to the class and than handles it further.</li>
  <li>Create a hashtable (key/value thing). Put all data in it. Send it of to the communicationlayer etc etc</li>
  </ol>
  
  <p>So it boils down to hashtable vs class.</p>
  
  <p>If I think 'loosely coupled', I favor hashtable. It's easy to have one module updated, include new extra params in the hastable, without updating the other side.</p>
  
  <p>Then again with a class I get compile-time type checking, instead of runtime.</p>
  
  <p>Has anyone tackled this previously and has suggestions about this?</p>
  
  <p>Thanks!</p>
  
  <p>edit:
  I've awarded points to the answer which was most relevant to my original question, although it isn't the one which was upvoted the most</p>