[Phpmyadmin-devel] Refactoring: Displaying query results
Chanaka Dharmarathna
pe.chanaka.ck at gmail.com
Thu Jul 12 03:36:17 CEST 2012
>
> >
> > Thanks for your suggestions.
> >
> >> > I introduced new function to initialize set of properties of
> >> > PMA_DisplayResults class which are not set inside the constructor.
> >> > That functions is appeared as processParams().
> >> > But I'm not sure its a good name for that method.
> >> > Will a name like setProperties() or setAdditionalProperties() more
> >> > suitable
> >> > for this function ?
> >> > Welcome to any suggestions.
> >>
> >> Hi Chanaka,
> >>
> >> Assuming that you are talking about the properties that are not set
> >> with a constructor parameter (the properties should be defined in the
> >> constructor anyway, but not necessarely with a value supplied by a
> >> constructor parameter), I think setProperties() is the best choice.
> >
> >
> > Yes, that's good.
> >
> >>
> >> Would this method only set the properties that cannot be set with a
> >> constructor parameter, or just any property?
> >
> >
> > This method only set the properties which cannot be set in constructor.
> >
> >>
> >> Maybe you can consider calling it setProperty($name, $value). This
> >> enables you to set just any parameter.
> >
> >
> > The class already have a method called __set($name, $value) to set any of
> > the property in class.
> > But since there are around 17 properties to initialized, I think better
> to
> > use this setProperties() method.
> >
> >>
> >> How are your properties defined? As single variables? Or as an array
> >> of properties?
> >
> >
> > Sorry if I'm not calling to your question. (I'm not clear about what you
> try
> > to ask.)
>
> This is what I meant : Do you have a single array (or an container
> class) with properties, like :
>
> private $_properties = array();
>
> or do you define all your properties seperately (ommiting the
> docblocks in this example) :
>
> private $_property1;
> private $_property2;
> private $_property3;
> ...
> private $_propertyN;
>
>
Hi Dieter,
Now I got that.
I have defined them separately as your second example.
Regards !
--
____________________________________
Chanaka Indrajith
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
Sri Lanka
____________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120712/bf71151f/attachment.html>
More information about the Developers
mailing list