On Fri, 2008-07-11 at 18:03 +0200, Yeti wrote:
> <?php
> 
> /*
> 
> I have a question here regarding object orientation in PHP and any other
> language.
> 
> Let's start with some hypothetical code:
> 
> */
> 
> // <--- 1st CLASS
> 
> class ParkingLot {
> 
> var size; // size in sq feet
> 
> var max_number_of_cars; // how many cars there is space for
> 
> function __construct($size, $max_cars) {
> 
> $this->size = $size; $this->max_number_of_cars = $max_cars;
> 
> }
> 
> };
> 
> cpark = new ParkingLot(50000, 17);
> 
> // <--- 2nd CLASS
> 
> class ParkingSpace extends ParkingLot {

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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to