0

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
user369117
  • 775
  • 1
  • 8
  • 19

1 Answers1

0

I would go with Sending the data in the message whenever possible

Sean Farmar
  • 2,254
  • 13
  • 10