title: Implementation of message in publish-subscribe pattern?
body: <p>I'm currently implementing the publish-subscribe pattern for use in my future applications. Right now I'm having trouble figuring out the "best" way to design the message part of the pattern. I have a couple of ideas in mind but please tell me if there's a better way to do it.</p>
  
  <p><strong>Idea 1:</strong> Each message is an object that implements a simple tag interface IMessage.</p>
  
  <p><strong>Idea 2:</strong> Each message is represented as an array where the first index is the type of message and the second contains the payload.</p>
  
  <p>Are any of these "better" than the other and if so, why? Please excuse me if this seems like a stupid question.</p>