You are here: Re: Test for the existence of a null property « PHP Programming Language « IT news, forums, messages
Re: Test for the existence of a null property

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация