I'm doing research and one point I want to cover is "What is the relationship between Domain-driven Design and Aspect oriented programming?"
I know that a main principle in DDD is separation of concerns and I understand that. What I'm not really certain is, whether aspects in AOP acts like "sub domains" in our domain in DDD.
Are these two concepts, basically the same thing. I mean, If I develop an application following AOP and DDD, at the end of the day will it be true that "a sub domain" == "an aspect".
I will also appreciate any other opinions what is the common between AOP and DDD.
Domain-Driven Design is a concept introduced by a programmer Eric Evans in 2004 in his book Domain-Driven Design: Tackling Complexity in Heart of Software. It is an approach for architecting software design by looking at software in top-down approach.
Entities and Value Objects in DDD are classic examples of OOP concepts since they have both state and behavior.
Microservices have a symbiotic relationship with domain-driven design (DDD)—a design approach where the business domain is carefully modeled in software and evolved over time, independently of the plumbing that makes the system work.
Domain-driven design (DDD) is a software development philosophy centered around the domain, or sphere of knowledge, of those that use it. The approach enables the development of software that is focused on the complex requirements of those that need it and doesn't waste effort on anything unneeded.
One of the goals of DDD is to have a pure representation of your business logic that is not influenced by your infrastructure. A very powerful tool to accomplish this is AOP. I primarily use AOP for infrastructure sub domains like logging, caching, validation and exception handling. I don't typically use AOP for actual business logic however validation is kind of both infrastructure and business logic.
In the cases where AOP bleeds into business logic, I use attributes/annotations to call out the behavior. For other concerns, I'll use policy/configuration to apply aspects.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With