-
Domain Model ORM Adapters
Posted on November 24th, 2009 1 commento I’ve had a series of articles that focus on domain model programming methodologies and most of my examples have demonstrated implementations using the Doctrine ORM (Object Relational Mapper). Given the nature of domain model programming I’ve held to the assertion that models built using this method are truly ORM agnostic and it should be effortless to swap out Doctrine for the ORM of your choice. Well I like to put my money where my mouth is by showing how easily this has been done by showing off adapters that I have written, one for Doctrine, and the other for Zend_Db. The beauty of this system is that both support the same ORM agnostic query syntax demonstrated in my recent post about creating complex sql queries using associative arrays. This means that no modifications are necessary in the models, controllers or views when switching ORMs. Developer’s utopia.
Read Entire Article
Development, Doctrine, PHP, Zend Framework Design Patterns, Doctrine, Domain Model Programming, ORM, SQL, Zend FrameworkRelated Topics
-
Doctrine, Complex SQL Queries, and Paginators
Posted on October 7th, 2009 No comments
Read Entire Article
In my efforts to build web applications using domain model programming I’ve encountered some interesting technical hurdles for keeping my implementation details away from my models. The most problematic issue that has come up time and time again has been that of using paginators. It’s very difficult to keep your paginator class in the dark about database implementation details and have it be able to handle complex use cases. Over the last few months I have slowly evolved a sophisticated way to describe a complex sql query using nothing more than an associative array which can be passed to a clueless paginator which talks to the database through a predefined interface to a model gateway. Yeah the mad scientist is me because that’s how I felt when I looked back on the pure genius of this method.
Development, Doctrine, PHP, Zend Framework Doctrine, Domain Model, DRY, Pagination, php, SQL, Zend FrameworkRelated Topics


