![]() |
|
|
|
|
|
|
2
20th November 04:17
External User
Posts: 1
|
Here's the point of your comfusion. ParkingSpace is not really a
ParkingLot is it? I mean you could say a parking lot having a single parking space qualifies, but not really. I see you problem being similar to apples versus apple tree. You wouldn't do the following (would you?): <?php class AppleTree { } class Apple extends AppleTree { } ?> Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP |
|
|
5
20th November 04:18
External User
Posts: 1
|
Listen to what everyone else has said so far. Look up IS-A versus
HAS-A. Favor composition over inheritance. You want your parking lot to have spaces, but spaces don't have to be in a parking lot. http://www.javacamp.org/moreclasses/oop/oop5.html |
|
| Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php |