Re: DB_DataObject's class generator
| From: | Justin Patrin | Date: | Sun, 12 Dec 2004 20:10:37 +0000 |
| Subject: | Re: DB_DataObject's class generator | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16191@lists.php.net to get a copy of this message | ||
On Sun, 12 Dec 2004 15:27:57 +0100, Torsten Roehr <roehr@zilleon.com> wrote:
> "Alan Knowles" <alan@akbkhome.com> wrote in message
> news:41BBC524.3090308@akbkhome.com...
>
>
> > I've had a few offers of patches to convert to private + setter/getters
> > - but none have been posted yet. :)
> >
> > I think the generator in cvs supports writing privates, but I havent
> > looked at it for a little while.
> >
> > There is a slight complication, as the joinAdd + links code will very
> > likely have to be changed, as they read/write from other objects.
> >
> > Regards
> > Alan
>
> Hi Alan,
>
> thanks for your response. As you seem interested I will try to add a
> buildGetters() method on top of the current CVS version next week. The use
> should be optional and default to false, so we need another option like
> 'buildGetters' => true.
>
> I won't touch the property declarations but maybe in the future they could
> be reformatted with a proper docblock. I will include docblocks in the
> getter declarations. IMHO it doesn't make sense to auto-generate setters -
> most developers will customize them anyway to include sanitization and
> validation of the input values so they should not be part of the
> auto-generated part of the class.
>
> What do you think (also regarding the name of the method and the option)?
>
I think that setters *should* be auto-generated along with getters.
Getters aren't really useful unless you have setters. I thought the
point of this option was to make a "private member vars" ready DO? The
dev just has to alter the parts of it that need different validation.
--
Justin Patrin