Is DDD and Entity Framework mutually exclusive?

11

I was exchanging comments with two users here SOPT over DDD and Entity Framework .

I have stated that DDD and Entity Framework are not mutually exclusive.

Or are they?

References:

What it really is or DDD

When to use entity framework with repository pattern

    
asked by anonymous 03.11.2016 / 17:35

2 answers

4

Not at all!

The DDD preaches that domain entities should not be aware of how persistence occurs. But that does not mean it does not exist! At the end of the day persistence is still required. A beautiful domain layer does not do much by itself.

What you should do if you practice DDD is to ensure that your software architecture is well designed and above all separated into well-defined layers.

Domain entities should play in one corner and persistence entities in another, linked (preferably) through data transfer objects (DTO's).

In short DDD focuses on domain area, but does not exclude persistence (EF). They are complementary concepts in building a program.

    
03.11.2016 / 18:13
2
DDD is a software modeling approach that follows a set of practices aimed at facilitating the implementation of complex business rules / processes that we treat as a domain. This approach does not depend on any technology to be built, nor is it a technology.

The Repository pattern can be used in conjunction with DDD in the infrastructure layer without any problems.

    
03.11.2016 / 18:59