DDD & TDD with Entity Framework, Part 1.a Refactoring & Unit Testing(mosesofegypt.net)
submitted by
mosessaur(5424) 3 years ago
In previous post I talked about building domain model for Northwind using Entity Framework. I used the generated ObjectContext class which is NorthwindDataContext as the basic Data Access Layer Helper. But my NorthwindDataContext is implementing custom interface I created in order to be able to make my Data Access Layer testable as well as to be independent from EF.
My target is to achieve decoupling between EF and all layers above it. This include Repository classes. This might not be of a big benefit to everyone, because my repositories implementation will still dependent on IDataContext. But for me it will help to do TDD more smoothly regardless of my underlying data access layer. Beside it might allow me in future to be able to switch from EF to LINQ to SQL and just implement my IDataContext interface for LINQ to SQL.
|category: Unit Testing
|Views: 579
tags:
EntityFramework mosesofegypt.net mosessaur DDD TDD another
Everyones tags:
Your Tags: