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:
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:
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.
The Repository pattern can be used in conjunction with DDD in the infrastructure layer without any problems.