-- Vince42 <[email protected]> wrote (on Monday, 27 July 2009, 12:53 AM +0200): > I am still working on some kind of scaffold to give beginners a head > start in ZF. > > During my ongoing quest for collecting ideas on best practices, I came > across two nice articles from Leendert and Matthew about building robust > PHP backends and the Domain Model approach. > > Incorporating those ideas, I drew a little sketch for myself in order to > better get the idea of that "extended MVC" pattern. See: > > http://imagebin.org/57263 > > Did I sketch it correctly or did I miss something important?
A few quick critiques: * What you term "Model" in this diagram is probably better termed an "entity"; see Benjamin Eberlei's Zend_Entity proposal for some background. * Service Layers are considered part of the "model". I'd group the services and entities together. * A service object may interact with multiple entities * A service object also will typically manage things like ACLs, validation, decorators (in the classic term, i.e., for decorating behavior in the entities, data mappers, etc.), etc. * A given controller action may potentially interact with multiple service objects, as well as individual entities themselves * A view may request service objects and/or entities related to the display logic. So you need an arrow from View to Model (where Model here means the group of service and entity objects, as well as any assisting objects such as ACLs, validators, mappers, etc). Overall, though, yes, looks reasonable. -- Matthew Weier O'Phinney Project Lead | [email protected] Zend Framework | http://framework.zend.com/
