On Tue, 13 Nov 2001, John \EvilJohn\ Carney wrote:

> >And is that legal? I was under the impression that interfaces, like
> classes, can only extend one interface.
> 
> Remember, you don't extend an interface (well you can, but that isn't
> what we're talking about here). You Implement it. You can implement as
> many interfaces as you want, so long as you're ready to write the code
> for the functions the interface calls for. Implementing an interfaces
> is NOT inhertience, but rather a contract.

in normal oo yes, but in ejb, the container implements it, and delegates
to your ejb.  so what you would need to do (in the case of comparable) is
have something like:

public interface MyLocalInterface extends EJBLocalObject, Comparable
{
  // normal busines methods
}

public class MyEJB implements EntityBean
{

  public int compareTo(Object other)
  {
    // implementation
  }

}

its of course not going to be possible to do it on the remote interface,
as the method would need to throw RemoteException, which would break the
Comparable contract.

someone correct me if I've missed something here...

cheers
dim

> 
> // EJ
> 
> Juergen Fiedler wrote:
> 
> >And is that legal? I was under the impression that interfaces, like
> >classes, can only extend one interface.
> >
> >Thanks,
> >j
> >
> >On Wed, Nov 14, 2001 at 05:48:37AM +1100, Dmitri Colebatch wrote:
> >
> >>You would actually need the remote/home interface to extend multiple
> >>interfaces yes, rather than the typical implement multiple interfaces.
> >>
> >[...]
> >
> 
> 
> 
> 
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to