Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can Domain driven design be combined with aspect oriented programming?

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.

like image 525
anthares Avatar asked Feb 15 '10 16:02

anthares


People also ask

Which approach we can use for domain-driven design?

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.

Is Domain-Driven Design OOP?

Entities and Value Objects in DDD are classic examples of OOP concepts since they have both state and behavior.

What is the connection between DDD and microservices?

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.

What is DDD in programming?

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.


1 Answers

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.

like image 113
Mike Valenty Avatar answered Sep 28 '22 09:09

Mike Valenty