News Feed
Sections




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

Rob Allen:
Objects in the model layer
March 22, 2013 @ 10:45:54

In this latest post to his site Rob Allen talks some about application structure and the different kinds of objects he uses in his applications.

I currently use a very simple set of core objects within my model layer: entities, mappers and service objects. [...] I dislike the phrase "service object" as the word "service" means so many things to so many people. I haven't heard a better phrase yet that everyone understands though.

He defines each of the types of objects to help make the separation clearer. Here they are in brief:

  • Entities are objects that represent something in my business logic.
  • Mappers know how to save and load an entity from the data store.
  • Service objects provide the API that the rest of the application uses.

Some of the comments on the post relate his choices to use in Zend Framework v2-based applications, noting that there are some base components you can extend to create these kinds of objects.

0 comments voice your opinion now!
object model entity mapper service oop structure znedframework2


blog comments powered by Disqus

Similar Posts

Pádraic Brady's Blog: Yadis: Service Discovery for Identities like OpenID

NETTUTS.com: Object-Oriented PHP for Beginners

Alex Netkachov's Blog: PHP fluent API tips

rooJSolutions Blog: Watch-out PHP 5.3.7+ is about.. and the is_a() / __autoload() mess.

Chris Hartjes' Blog: Dynamic Models in CakePHP 1.2


Community Events





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


interview framework introduction community deployment code language conference bugfix series zendserver threedevsandamaybe release voicesoftheelephpant api laravel tips podcast list symfony

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