3 ms·
> People always seem to ignore the third option: using an ORM that embraces SQL! I had a similar revelation several years ago, based on the distinctions betwee
by pmjones 6y ago
> People always seem to ignore the third option: using an ORM that embraces SQL!
I had a similar revelation several years ago, based on the distinctions between a "domain model" and "persistence model" described by Mehdi Khalili, resulting in Atlas for PHP: http://atlasphp.io http://atlasphp.io
- dsego 6y agoDoes this correspond to the data mapper pattern? Seems like people mostly object to active record orm variants. https://typeorm.io/#/active-record-data-mapper/what-is-the-data-mapper-pattern https://typeorm.io/#/active-record-data-mapper/what-is-the-d...
- pmjones 6y agoYes, the upper/outer layers are a Data Mapper implementation; cf. the Atlas.Mapper package. FWIW, the Data Mappers are built on top of Table Data Gateways, which in turn are built using Query Builders and a connection locator. This lets you start at lower levels and work your way up, while at the same time allowing you to "reach down" from the upper levels to the lower ones when you need to.