What are the pros and cons of sending the Id or the full object in a message?
If I send a message with about an Order + Orderlines from system A to system B I can send the full order or first store the Order and then send the Id. I'm not sure which one to choose.
Sending full object
Pros
- No need to store the object first on the sending side
- No need to retrieve the object on the receiving side
Cons
- ?
Sending Id
Pros
- The receiver can get the latest version of the thing being sent
Cons
- Object must be stored first
- Object must be retrieved
- The receiver doesn't have the data from the moment of sending, but from the moment of handling the message