Implementing Domain-Driven Design
Rate it:
Open Preview
65%
Flag icon
A third way to integrate Bounded Contexts is by using RESTful HTTP.
76%
Flag icon
The Application Services are the direct clients of the domain model. For options on the logical location of Application Service, see Architecture (4). These are responsible for task coordination of use case flows, one service method per flow. When using an ACID database, the Application Services also control transactions, ensuring that model state transitions are atomically persisted. I discuss transaction control here briefly, but see Repositories (12) for a broader perspective. Security is also commonly cared for by Application Services.
76%
Flag icon
It is a mistake to consider Application Services to be the same as Domain Services (7). They are not. The contrast should be stark, which is clearly demonstrated in the next section. We should strive to push all business domain logic into the domain model, whether that be in Aggregates, Value Objects, or Domain Services. Keep Application Services thin, using them only to coordinate tasks on the model.
76%
Flag icon
Some types from the domain model are used in these method signatures. That will require the user interface to be aware of these types and depend on them. Sometimes the Application Services are designed to completely shield the user interface from all such domain knowledge. Doing so, the Application Service method signatures use only primitive types (int, long, double), Strings, and possibly DTOs.
76%
Flag icon
Consider the trade-offs. If you eliminate types from the model, you avoid dependency and coupling, but you lose out on strong type checking and basic validations (guards) that you get for free from Value Object types. If you don’t expose domain objects as return types, you will need to provide DTOs. If you provide DTOs, there may be accidental complexity in your solution from the extra overhead of the additional types. Then there is also the aforementioned memory overhead in high-traffic applications that is caused by the possibly unnecessary DTOs constantly being created and garbage ...more
« Prev 1 2 Next »