News Feed
Jobs Feed
Sections




News Archive
Court Ewing's Blog:
The Best Models are Easy Models
May 10, 2010 @ 15:51:57

In a recent post to his blog Court Ewing talks about what he sees as one of the most important parts of any framework-based application - good, easy models that are simple to use and well structured.

By treating your models as nothing more than a place to dump your data, you are doing yourself and your application a severe disservice; your business logic is going to be scattered throughout the rest of your application, and you will have a progressively more difficult time as you try to maintain and build upon your existing system. Do not fall into the anemic model trap.

He gives examples of good models (based on how Doctrine 2 handles them) to work with the data for a sample blogging application. His main "Article" model pulls from an abstract one to help define some relationships and magic methods to handle class properties in a protected and private way, depending on the context. He finishes the post with an example of how to use these new model classes to interact with his blog data.

0 comments voice your opinion now!
model anemic tutorial easy doctrine


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Implementing a Unit of Work - Handling Domain Objects through a Transactional Model

VT\'s Tech Blog: A Few XML & PHP Tutorials

Joshua Thijssen's Blog: Using vagrant and puppet to setup your symfony2 environment

AlternateInterior.com: Communicating with threads in PHP

Zend Developer Zone: Integrating PHP with System i using Web Services


Community Events











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


object phpunit conference opinion example series zendframework2 podcast unittest introduction functional language interview tool development code community testing framework release

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