News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Building a Domain Model - Integrating Data Mappers
March 19, 2012 @ 11:27:26

In this previous post PHPMaster.com introduced you to the concept of "domain models", structures defining how data should be formatted for consistency. In this second part of the series, Alejandro show show to integrate them with a data access layer (DAL) to make them easier to work with.

The phrase may sound like an cheap cliché, I know, but I'm not particularly interested in reinventing the wheel each time I tackle a software problem (unless I need a nicer and faster wheel, of course). In this case, the situation does warrant some additional effort considering we'll be trying to connect a batch of mapping classes to a blog's domain model. Given the magnitude of the endeavor, the idea is to set up from scratch a basic Data Access Layer (DAL) so that domain objects can easily be persisted in a MySQL database, and in turn, retrieved on request through some generic finders.

He includes all the code you'll need to create a (namespaced) database adapter (PDO), the mapping layer to tie the domain models together and using it all in a practical "blog" example with posts, comments and users.

0 comments voice your opinion now!
integrate domain model data mapper tutorial pdo database


blog comments powered by Disqus

Similar Posts

Gonzalo Ayuso's Blog: Building an ORM with PHP

PHPMaster.com: File Uploads with PHP

Smashing Magazine: Ask SM [PHP]: Form Validation, Converting MySQL to XML

The Bakery: Six New Components/Articles/Tutorials (SOAP, XHR, Tickets, Models, Releases & Flashes)

Jim Plush\'s Blog: AJAX, PHP and Javascript Errors - How to get more data


Community Events





Don't see your event here?
Let us know!


bugfix framework release series voicesoftheelephpant introduction unittest package community library laravel language api symfony podcast deployment opinion zendserver interview install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework