Amazium bvba, your online partner
ZF Model Layer: Part Service, Part ORM
  • Share post with Twitter
  • Share post with StumbleUpon
  • Share post with Delicious
  • Share post with Digg
  • Share post with Technorati
  • Share post with Blinklist
2010-01-22 00:01

ZF Model Layer: Part Service, Part ORM

models, zend framework

In a new post on the Rdavid.net blog there's some discussion about Zend Framework models, the best approach and a "Service Class" idea

After some more thought and lots of research on the subject, I've come to a solid point where I actually have something to try out which seems semantic aside from the naming of the class (Service Class) '" but this is derived from what some people are talking about in ZF circles starting from Matthew Weier O'Phinney who was coining it as the "Gateway to the Domain" from early on, then later changing it to "Service Class".

He defines what his service class idea is - a layer between the database and each of the models that allows them to be agnostic about what kind of service they're using. He also breaks down some of the key points around his approach including the fact that the Model Service can create Forms and that the Model Service can use the Zend_Cache component directly for improving performance. Be sure to check out the comments for thought from other Zend Framework developers.

Read it at : http://www.rvdavid.net/my-zend-framework-model-layer-part-service-part-orm

Comments and Feedback
I think a heat-map would tell you that a class as such is not recommended. The service class to me in Zend Framework would just be the mapper that interacts between the TDG and the Model classes.

If you download the latest code from the zend quick-start tutorial you can see a 'perfect' example. (http://framework.zend.com/demos/ZendFrameworkQuickstart.zip). In this example the model (Guestbook) just has properties and accessors. The TDG (DbTable class) deals with the database and the Service class (Mapper) deals with transforming the representation of the Data layer into a representation in php. Be it from a relational model with rows and attributes to a Object model like a class with properties.

Other functionality resides elsewhere (SOC).

Add a Comment

Your email is never published or shared. Required fields are marked*