|
Posted by wildernesscat on 08/09/06 06:53
Hi Jerry,
> You can use is_a() as Marcin suggested. But what's to stop me from
> creating my own class 'A'?
As I told Marcin, is_a() will not be of much use here. I need an
in-depth comparison, and not just resemblance in names.
> The real question is - why do you need this "feature"? It violates
> several principles of OO.
Actually, I don't think that I violate any major OO principles. This is
almost like asking an object whether it supports certain interfaces.
I'll pinpoint my question. I want to know whether a certain object has
the _public_ properties of a given class. Does that make sense? Suppose
I have an object that has public properties $aaa, $bbb, and $ccc - I'd
like to know whether class A also has them.
> OO principles include that you don't care WHAT the object is - all you
> care about is its interface (functions). If you need to depend on a
> specific class, you need to rethink your design.
>
Regards,
Danny
Navigation:
[Reply to this message]
|