Tuesday, December 25, 2018

Martin Fowler Data source Patterns


Latest Repository based ORMs &
Martin Fowler Data source Patterns
Julie Lermen Patterns to
Encapsulate EF based Data Access Code
Encapsulate ORM based Data Access Code
Encapsulate Repository based Data Access Code

How Martin Fowler Data Source Patterns are related to the Julie Larmen Pattners and Latest ORMs + Repositories + UOW. This is all mixed up and overlapped. I try to draw lines here.

Martin Fowler Data Source Patterns are described based on the ADO.NET or JDBC. But these patterns can be implemented while we are using ORM.

In case of ADO.NET we deal with physical database and code things at the low level. That is why the ADO.NET implementation of MF Data source patterns are very messy.

In case of ORM or EF, we deal with in memory database and code things against in-memory collections. I think we can implement same MF Data Source Patterns on the top of EF. EF based implementation of MF Data Source Patterns is very simplified and we do not have to bother too many things in those.

Complex MF Data Source Patterns ç ADO.NET
Simplified MF Data Source Patterns ç EF ç ADO.NET



1.  Single Table based Simple CRUD Operations

In my Opinion, MF Table Data Gateway Pattern is mostly done with EF and it is most suitable to repositories. We have Table based Data Access API that allows us to package CRUD operations against a Table in a single Class. Generic Repository gives use Table based CRUD API to play with tables. RowDataGateway and Active Record Pattern are never seen in practical projects nor in EF world. There is huge overlap between Data Mapper and Repository Pattern.

2.  Multiple Table based Complex CRUD Operations

Secondly, we can have Complex Use Case Scenario based CRUD Operations those involve many Tables, Views, Transactions, Custom DTOs, DB-JOINS and multiple and conditional CRUD Operations.

3.  Separating Queries & Commands

Thirdly, we can further split the 2, into two types, Command and Queries.








No comments:

Post a Comment