Tuesday, December 25, 2018

Pattern No. 5 for Encapsulating EF based Data Access Code

We are using Data Mapper + Domain Model + Service Layer + Repository + UOW from MF Patterns of EAA in the modern OCH based Applications and Frameworks. 

Julie Lermen has identified 5 Pattern to encapsulate the Data Access Code. All these Patterns are based on Repository and UOW.

All these five Pattern are Repository  and UOW Based Solutions,


1. Screen/UseCase/Feature/BussinessScenario/BoundedContext/Aggregate  |Repository CompositeObj-Specific-Domain-Oriented Repository & UOW |Return 1 or more Complex Obj having different types | Complex Class has Other Classes inside | Complex Class has dense domain logic inside | Core Domain Oriented/ DDD| Repository Data Class | DBContext is Wrapped Inside class | DBContext is UOW | Custom Class | Query or Save in Multiple Tables | Always Called by Application Service. Custom Class with Complex Persistence Logic following the Repository pattern or Explicit Class with Complex Data Access Logic following the Repository pattern. Generic Repository does not work in these scenarios. | Deals with Multiple Tables, and Multiple Rows in Joins or Views | Aggregate Objects or Composite Objects, User Defined Class. | Generic User defined class around the DBContext and DBSet. DBContext is the UOW that is used in combination with it. | Multiple Table Business Operations | Business Transactions | Graphs based Queries | Classes Can be further divided into Commands (CUD) and Queries (Read)

No comments:

Post a Comment