2009/3/26 Giorgio Sironi <[email protected]>: > 2009/3/26 keith Pope <[email protected]> >> >> Remember that Zend_Form has three aspects, display, validation and >> filtering, therefore it is reasonable to only use the validation and >> filtering parts in your Model, they then act like a domain level >> service to your Models. > > I find a bit tricky to incorporate a class that does html displaying in my > models and I currently resist to the urge of using Zend_Form inside models. > My approach is to define Doctrine domain objects with internal validation > and to use some introspection to generate Zend_Form objects from a given > model.
I would disagree about having a class that does html in a model, if you use Zend_Form in a model all you are doing is using the validation and input filtering display is still at the view level. Though your approach is just as valid and sounds like a good way of using doctrine. > >> >> I find it useful to remember that the MVC dependency rule goes: >> >> Interface (View) >> Application (Controller) >> Domain (Model, Services etc) >> Infrastructure (DB,Session, libraries) >> >> Dependencies go in a downwards direction, so Application can depend on >> Domain but Domain should not depend on Application. > > Remember that dependencies are transitive, so using this this rules means > that my .phtml views depend on db. Indeed they can do :) > > -- > Giorgio Sironi > Piccolo Principe & Ossigeno Scripter > http://ossigeno.sourceforge.net > -- ---------------------------------------------------------------------- [MuTe] ----------------------------------------------------------------------
