Reply to interfaces - your opinion

Your name:

Reply:


Posted by Jochem Maas on 12/29/05 18:31

anyone here work with Interfaces? I do and I like them alot;

I recently ran into a situation where it would be nice to be able to specify
that a given interface is only allowed to be implemented by a certain
class (and all subclasses thereof) - Anyone have an idea as to how
to implement such a restraint in a clean way? does anyone think that this
is generally useful?

maybe it's something that should not be done at all.
maybe the implementation belongs in the engine (with some new syntax) e.g:

class MyClass {}
class MySubClass extends MyClass {}
class MyOtherClass {}
class SomebodyElsesClass {}

interface MyIface validfor MyClass, MyOtherClass
{
abstract function blabla();
}

// SomebodyElsesClass would not be able to implement MyIface


interested to know if anyone has an opinion on this.

rgds,
Jochem

[Back to original 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

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