(on Tuesday, 16 December 2008, 08:53 AM +0100):
> Hi Kevin,
>
> Am Montag, den 15.12.2008, 12:20 -0800 schrieb j5:
> [...]
> > I am wondering what are the benefits of creating a parameter object over an
> > array? First thing I can think of is the criteria object can filter the
> > input and set proper defaults so I wont have to do that in the
> > getBlogEntries() method?
>
> Exactly, validation, filtering and guaranteeing completeness of the
> parameters can be done in such an object. I'm sorry for not providing
> any information on this yesterday, here we go:
> http://www.refactoring.com/catalog/introduceParameterObject.html
> [...]
BTW, Zend_Form can act like a parameter object as well. While much of
the value of Zend_Form comes from its ability to render itself, the fact
is that it is also at its heart an input filter. I've been attaching
models to my forms for a while now.
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论