Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /tests/classes interface_class.phptinterface_doubled.phpt interface_implemented.phpt interface_instantiate.phptinterface_member.phpt interface_method.phpt interface_method_final.phptinterface_method_private.phpt interface_must_be_implemented.phpt

2003-03-12 Thread Sebastian Bergmann
Andrei Zmievski wrote:
 class blah implements interface is confusing.

  That is possible? It shouldn't be ;-)

-- 
  Sebastian Bergmann
  http://sebastian-bergmann.de/ http://phpOpenTracker.de/

  Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

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



Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /tests/classes interface_class.phptinterface_doubled.phpt interface_implemented.phpt interface_instantiate.phptinterface_member.phpt interface_method.phpt interface_method_final.phptinterface_method_private.phpt interface_must_be_implemented.phpt

2003-03-12 Thread Shane Caraveo
Andrei Zmievski wrote:
On Wed, 12 Mar 2003, Sebastian Bergmann wrote:

 I have seen extended interfaces quite often in the Java world.

 IIRC, the following code currently runs without problems and it should
 stay that way, if it does not harm us in any way:
   ?php
   interface Foo {}
   interface Bar extends Foo {}
   class FooBar implements Bar {}
   ?


I wasn't talking about interfaces extending interfaces - that is
perfectly fine. I was saying that class blah extends interface and
class blah implements interface is confusing.
-Andrei   http://www.gravitonic.com/
A class extending an interface seems just weird to me.  classes should 
only extend classes, and implement interfaces.  interfaces can extend 
interfaces.  I haven't been following the interfaces stuff (I'm going to 
have to backtrack and read it all, very happy if this stuff will do what 
I want), but I would hope we have some capability of implementing 
multiple interfaces in a class somehow.

interface JAZ {}
interface FOO {}
interface BAR extends FOO {}
class foo implements FOO {}
class foobar extends foo implements (BAR,JAZ) {}
Shane

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


Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /tests/classes interface_class.phptinterface_doubled.phpt interface_implemented.phpt interface_instantiate.phptinterface_member.phpt interface_method.phpt interface_method_final.phptinterface_method_private.phpt interface_must_be_implemented.phpt

2003-03-12 Thread Shane Caraveo
Marcus Börger wrote:
At 20:20 12.03.2003, Andrei Zmievski wrote:

On Wed, 12 Mar 2003, Marcus Börger wrote:
 This works even though i do not like  extends FOO.
Why? Both C# and Java (AFAIR) allow interfaces to extend other
interfaces.


Because of the second part of the answer. It is a little bit strange that
an interface can extend and implement an interface but a class can
only implement interfaces. Also it is a bit weired that i can implement
multiple interface but extend only one.
An interface should not implement an interface, only classes should 
implement interfaces.  'implement' infers that actual executable code is 
provided that implements an interface.  Again, I haven't followed the 
interface stuff, and sorry for writting without reading the background, 
but I'm working off the assumption that interfaces are kind of like IDL.

ok:
interface extends interface
class extends class implements interface
not ok:
interfaces implements interface
class extends interface
Shane

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