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 - An Introduction to Persistence Agnosticism
February 27, 2012 @ 12:58:00

On PHPMaster.com there's a recent tutorial introducing the concept of a "domain model" and showing how to create them in PHP (manually, not inside of any ORM or database solution).

First off, creating a rich Domain Model, where multiple domain objects with well-defined constraints and rules interact, can be a daunting task. Second, not only is it necessary to define from top to bottom the model itself, but it's also necessary to implement from scratch or reuse a mapping layer in order to move data back and forward between the persistence layer and the model in question.

They include an example of a set of domain models tat relate to one another - a blog setup with posts, comments and users. They show how to create the AbstractEntity to handle a bit of the magic behind the scenes, an example "Post" and "Comment" models and how they can be put to work creating some posts and appending comments. A little bit of markup is included to output the results.

0 comments voice your opinion now!
domain model relation tutorial blog post comment user


blog comments powered by Disqus

Similar Posts

Site News: Popular Posts for the Week of 08.10.2007

Herbert's Blog: PHP with SQL on Google App Engine

Internet.com: Passing Data Between PHP and JavaScript Using JSON (Video)

Job Posting: Engage Seeks a PHP/MySQL Applications Developer (Work from Anywhere)

Mrinmoy Ghoshal's Blog: Concept of Strings:PHP


Community Events





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


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

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