hi all.

i have a class that uses several subclasses (mostly data containers) which 's definitions are in the same file like the main class.
now i remarked that phpDocumentor does not seem to find those sub classes.

might this be because it is no common to have more than one class in a file? what's your opinion, is it ok to have several classes in just one file? or should i have a file for each single class?

thank you for your opinions.
josh

    i beleive its common to only have a single class per file.

    it makes sense if you think about it, if you only need 1 class you shouldnt have to define a few of them(even though the subclasses may depend upon a parent, that may not always be the case)

    i know ive seen people use require_once('parent_class.php') in subclass files. that way, if it depends on another class, the require_once will make sure its defined, w/out risk of defining it twice.

    but im pretty green to oo, so definately seek more opinions

      Write a Reply...