Framework Data/ORM Abstraction Layer
Random late-night thought: how long before someone starts working on a PHP "Framework Data/ORM Abstraction" layer? By which i mean something like PEAR::DB but instead of abstracting a database the layer abstracts the ORM implementations of a framework.
Let's say i'm an application developer writing Some Cool Module that i want people to use in their own code, independent of the framework that they may or may not use. My code has to store/retrieve data from somewhere to populate its objects, but i don't want to tie the end-user-developer into my implementation. The idea is that my code "plays nicely" within its host environment and makes no assumptions about things like databases /connections/storage - it just needs to know how to CRUD an object.
I could maintain distributions of My Module for each framework (but that would suck big-time). Instead i design My Module so that it defers the CRUD operations to some other object - an object that is specific to the framework. That object would return a standardised "Model" object that my code could then carry on working with.
Tada! The Framework Data/ORM Abstraction Layer is born! We even have a cool acronym for it - FORMAL (haha). FORMAL is to Frameworks what PEAR::DB is to RDBMSes.
I'm pretty sure this is a really stupid idea, by the way. But - i do like the concept of not coupling ORM into My Module...
Let's say i'm an application developer writing Some Cool Module that i want people to use in their own code, independent of the framework that they may or may not use. My code has to store/retrieve data from somewhere to populate its objects, but i don't want to tie the end-user-developer into my implementation. The idea is that my code "plays nicely" within its host environment and makes no assumptions about things like databases /connections/storage - it just needs to know how to CRUD an object.
I could maintain distributions of My Module for each framework (but that would suck big-time). Instead i design My Module so that it defers the CRUD operations to some other object - an object that is specific to the framework. That object would return a standardised "Model" object that my code could then carry on working with.
Tada! The Framework Data/ORM Abstraction Layer is born! We even have a cool acronym for it - FORMAL (haha). FORMAL is to Frameworks what PEAR::DB is to RDBMSes.
I'm pretty sure this is a really stupid idea, by the way. But - i do like the concept of not coupling ORM into My Module...


0 Comments:
Post a Comment
<< Home