CQRS Commands and Queries – Do they belong in the domain?

Commands and Events can be of very different concerns. They can be technical concerns, integration concerns, domain concerns… I assume that if you ask about domain, you’re implementing a domain model (maybe even with Domain Driven Design). If this is the case I’ll try to give you a really simplified response, so you can have … Read more

What is a practical way to model lookup tables in Domain Driven Design (DDD)?

You may want to look into the concept of Command Query Separation. I wouldn’t worry about typed repositories for lookup values, but I’d still probably use DTO type classes over datasets etc… You may want to spend some time reading Greg Young’s blogs starting from this one to the present. He doesn’t talk about filling … Read more

How are Value Objects stored in the database?

It’s ok to store Value Objects in a separate table, for the very reasons you’ve described. However, I think you’re misunderstanding Entities vs VOs – it’s not a persistence related concern. Here’s an example: Assume that a Company and Person both have the same mail Address. Which of these statements do consider valid? “If I … Read more

Value vs Entity objects (Domain Driven Design)

Reduced to the essential distinction, identity matters for entities, but does not matter for value objects. For example, someone’s Name is a value object. A Customer entity might be composed of a customer Name (value object), List<Order> OrderHistory (List of entities), and perhaps a default Address (typically a value object). The Customer Entity would have … Read more