Skip to content

Sponsor: Do you build complex software systems? See how NServiceBus makes it easier to design, build, and manage software systems that use message queues to achieve loose coupling. Get started for free.

Learn more about Software Architecture & Design.
Join thousands of developers getting weekly updates to increase your understanding of software architecture and design concepts.


Follow @CodeOpinion

Messaging

Why use DTOs (Data Transfer Objects)?

Should you really use DTOs (Data Transfer Objects)? Seem like a lot of work mapping your database entities to another object? Why Bother? The simple answer is coupling. Data Transfer Objects First, what are DTOs? When people refer to Data Transfer Objects, what they mean are objects that represent data structures that generally do not contain any business logic or behavior. If they do contain behavior, it’s generally trivial. Data Transfer Objects are often used to be serialized by the producer and then deserialized by the consumer. Often times these consumers may live in another process being used by an… Read More »Why use DTOs (Data Transfer Objects)?

Message Sender: Who Sent the Command/Event?

When handling a message, regardless if it’s a command or event, you often want to know who sent the message. Who was the message sender? Not the service, but the actual user who initiated it. If it’s a command then who invoked it. If it’s an event, who invoked the command that changed state within the system that created the event. This post is in a series related to messaging. The overview is available in my Message Properties post. Authorization The most common reason for wanting to know who sent a message is to determine if they are authorized to… Read More »Message Sender: Who Sent the Command/Event?

Message-IDs for Handling Concurrency

This post serves as a guide for how you can use a Message identification (Message-IDs) on your messages (events and commands) to handle concurrency. This post is in a series related to messaging. The overview is available in my Message Properties post. YouTube If you haven’t already check out my YouTube channel. Message-IDs Each message, regardless of it being an event or a command, should contain a way to identify its specific instance of that message. This is as simple as adding a GUID/UUID to your messages: No other message (event/command) should ever use this ID (unless you’re also using… Read More »Message-IDs for Handling Concurrency