Re: Class-/Filenaming/Directorystructure RFC
| From: | Stefan Neufeind | Date: | Mon, 26 Apr 2004 22:27:44 +0000 |
| Subject: | Re: Class-/Filenaming/Directorystructure RFC | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-28386@lists.php.net to get a copy of this message | ||
On 26 Apr 2004 at 15:43, Lukas Smith wrote:
> Chuck Hagenbuch wrote:
> > Quoting Tobias Schlitt <tobias@schlitt.info>:
> >
> >> From the recent discussion I assume, that the part concerning 1 class per
> >> file is left as is.
> >>
> >> Are there any further objections?
> >
> >
> > Yes. I see no proof that this is *always* better, there are definitely
> > cases
> > where it's just silly overkill, and I see no good reason to mandate it
> > either
> > way.
>
> well you have two choices
>
> 1) wait for the call for votes and vote against
> 2) come up with concrete ideas which make your POV clear (in order to
> influence the voting decisions) or which help to expand the current RFC
> where needed
I also do think that usually the rule is very good, but should allow
exceptions in certain cases. To come up with one example:
The file "Elements.php" of Image_Graph contains several, mainly small
elements. They only get their size from the phpdoc-comments actually
:-)) They are mostly just for storing data or very short functions.
Splitting all classes in this file into separate files would imho be
an overkill, since a lot of Elements rely on parent-classes.
http://cvs.php.net/co.php/pear/Image_Graph/Graph/Elements.php?r=1.20
This is one of the cases where I think it makes sense to not split up
the classes in too many files. However, this exception is surely hard
to put into words and imho needs to be decided on a case by case
basis. Elements.php was also discussed because of this same
background with various people - but all mainly agreed that in this
case speed weighs more.
Please note that all other classes in Image_Graph are split into
separate classes to load only the really needed classes and to be
more flexible.
Stefan