Re[2]: [PHP-DEV] aggregation?
| From: | (Marcus B�rger) | Date: | Thu, 26 Jun 2003 18:47:26 +0000 |
| Subject: | Re[2]: [PHP-DEV] aggregation? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-2859@lists.php.net to get a copy of this message | ||
Hello Wei,
Thursday, June 26, 2003, 11:16:16 AM, you wrote:
WH> On Thu, 26 Jun 2003, Sebastian Bergmann wrote:
>> Wei He wrote:
>> > How could I live without aggregation or multiple inheritance?
>>
>> Java developers are very happy without these concepts. Why? Because
>> they have interfaces. Guess what? We have them, too.
WH> If I understand correctly, using of interfaces will force a subclass to
WH> implement an interfaced method even if this method behaves the same
WH> as one of its parent classes.
wrong
A class that implements interfaces inherits all methods defined in the
interfaces as abstract methods. In other words the class is abstract if
not all interface methods are implemented. From there normal inheritance
rules apply.
WH> If so I'll have to copy method codes from parent classes like what I
WH> have do so in PHP4 without aggregation. Right?
No, the method implementations are inherited.
--
Best regards,
Marcus mailto:helly@php.net