Robert Cummings wrote:

Method overriding is one of the core principles of any Object Oriented
(OO) language. By having second_class extend first_class you get all the
functionality of first_class, but generally you extend a class because
you want to inherit all of the functionality with a few differences. For
this reason method overriding is important to get the different
functionality but maintain the developer interface. So yes the behaviour
you are asking about is correct. Generally speaking I can't see a
problem occuring between Smarty and ADODB, since you are extending
these, and you can currently only extend one or the other. So it follows
that multiple definitions cannot occur unless you specifically attempt
to multiply define the same method.

Thanks for replying.
The idea that I have in mind is something like ->
1.  Create a dummy class with no methods/variables (if neccessary).
class dummy
{
}

2.  Have ADODB extend dummy
class ADODB extends dummy
{
   function Execute()
   {
   }
}

3.  Have Smarty extend dummy
class Smarty extends dummy
{
   function display()
   {
   }
}

Repeat as neccessary for other known classes, or autoload them from a function.
So if method overwriting is normal behaviour, then the idea I have is potentially not sound as it can break interfaces.
Is it the best way to go, Im not sure at the moment.
I may just leave my code as it is. Im passing the DB object by reference. So what am I worried about....
Thanks again...


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



Reply via email to