DDD (domain driven design) is a useful concept for analyse of requirements of a project and handling the complexity of these requirements.Before that people were analysing these requirements with considering the relationships between classes and tables and in fact their design were based on database tables relationships it is not old but it has ...
I keep seeing DDD (Domain Driven Design) being used a lot in articles - I have read the Wikipedia entry about DDD but still can't figure out what it actually is and how I would go about implementin...
Indeed in DDD you shouldn't expose domain model to the controllers. (1) RestApiCommandController: One method per command use case. The REST resource in the URI is the command class name. The method is always POST, because you create the command, and then you execute it through a command bus (a mediator in my case).
Entity versus Value object In DDD, you model your business cases using domain objects. These objects can fall into 2 categories: entities and value objects. Entites have a natural key to identify them, wheras value objects are solely identified by their value. For instance, in my country, the department of justice considers that the identity of a person is a composition between the following ...
To your last point, services in DDD are a place to put what I describe as "awkward" logic. If you have some type of logic or work flow that has dependencies on other entities this is the type of logic that usually doesn't "fit" inside a domain object itself. Example: If I have a method on my business object to perform some type of validation, the service class might execute this method (still ...