Re: class? package?
| From: | Shelley | Date: | Tue, 10 Jun 2008 13:44:07 +0000 |
| Subject: | Re: class? package? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275176@lists.php.net to get a copy of this message | ||
On Tue, Jun 10, 2008 at 6:32 PM, Iv Ray <pobox@verysmall.org> wrote:
> If you are designing with OO principles, could you give an explanation of
>> what is the difference classes and packages?
>>
>
> A class is a language construct, classes are processed/executed by php.
>
> A package is an architectural approach - this is how you combine your
> code/classes.
Yeah, I can guess that.
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? :-(
>
>
> When I was summarizing the OO principles, that question confused me:
>>
>>
>> http://phparch.cn/index.php/php/43-php-advanced-programming/170-principles-of-object-oriented-design
>>
>
> If you try to follow all these principles, it might take very long before
> you write even a line of code ;)
>
True.
>
> Take what you understand and leave the rest for later. You will become
> better, but will never be perfect ;)
>
You will never be perfect, but you will become better. ;)
>
> Iv
>
> --
>
Thank you any way.
--
Regards,
Shelley