|
In conclusion
Domain-driven design and service-oriented design are opposite approaches. Domain-driven design relies mainly on encapsulated objects with state and behavior, whereas SOA emphasizes the procedure (a service). Object-oriented applications tend to be stateful, SOA rather stateless. The best practices in one case become anti-patterns in the other.
Interestingly, SOA is a good match to SOAP services defined in Web Services Description Language (WSDL), which emphasize contracts and actions. In contrast, REST focuses on direct addressing and manipulation of resources, which is more compatible with the domain-driven approach.
This article is based on Adam Bien's forthcoming book: Real World Java EE Patterns: Rethinking Best Practices. |
|