Re: class? package?
| From: | Iv Ray | Date: | Thu, 12 Jun 2008 07:01:59 +0000 |
| Subject: | Re: class? package? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275254@lists.php.net to get a copy of this message | ||
Shelley wrote:
Probably you have noticed this: The classes in a package are reused together. If you reuse one of the classes in a package, you reuse them all. If that's the case, then why not just use one class as one package? What's the point of splitting a package into several classes? :-(I think somebody already answered. It is actually up to you. My grandmother used to write letters starting with a capital letter, writing the whole letter as one long sentence and ending with a dot. This would perhaps confuse most high school teachers, but in her case it somehow worked :) If we take this worn out example - if you have a class "dog" and a class "cat" - it becomes quite clear why you need several classes. You can put them in a package called "animals" - but as other people already noted, the "packages" in php have only a symbolic role, just for clarity of code organization. Iv