You are here: Re: [PHP] Re: PHP 5.1 CVS Interface Question « PHP « IT news, forums, messages
Re: [PHP] Re: PHP 5.1 CVS Interface Question

Posted by Jochem Maas on 03/03/05 17:26

Gavin Roy wrote:
> Stolen from a oo reference site (who's URL I no longer have handy):
>
> "An object interface--or simply interface--defines methods that can be
> implemented by a class. Interfaces are declared like classes, but
> cannot be directly instantiated and do not have their own method
> definitions. Rather, it is the responsibility of any class that
> supports an interface to provide implementations for the interface's
> methods. A variable of an interface type can reference an object whose
> class implements that interface; however, only methods declared in the
> interface can be called using such a variable."
>
> That goes with my understanding as interfaces being one more level of
> abstraction from abstract classes. That is they define the rules for
> the classes that implement them, but not any code (where an abstract
> class can implement code). I guess my understanding of an interface
> is wrong?
>

no not really - only the PHP devs have a particular view of what an interface
should be / how it should be used. other groups have different views.

personally I don't _think_ you are using a 'good' paradigm for you class heirachy -
but its impossible to tell for sure - I'd have to see much more code :-)

btw: if you drop the 'static' from the interface definition and from the class definitions
(of the interface) you can still use/call the methods statically...

....

 

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

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