Mitch Rosenburg
Mitch Rosenburg

Reputation: 223

NServiceBus Event Information

I'm trying to decide what information my Event DTOs should contain in a pub/sub scenario.

I see two possibilities:

1) All the information that could be needed by subscribers

interface UserInvitedToGroup
{
  string GroupName {get; set;}
  string UserName {get; set;}
  DateTime DateInvited {get; set;}
  // etc, etc ...
}

or

2) Just the Id's of the entities affected.

interface UserInvitedToGroup
{
   int GroupId {get; set;}
   int UserId {get; set;}
}

Obviously in this scenario the subscriber would need access to the data store as well to get the information that is actually usable.

I lean towards the second since I am not sure exactly the information a subscriber will need.

Upvotes: 0

Views: 66

Answers (1)

Andreas Öhlund
Andreas Öhlund

Reputation: 5273

I would recommend #2. Then have you subscribers subscribe to your UserCreated and GroupCreated events as well if they are interested in the user or group details.

Upvotes: 1

Related Questions