avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Hammant <Paul_Hamm...@yahoo.com>
Subject [altrmi] Casting on the client side
Date Mon, 08 Apr 2002 19:14:55 GMT
Consider a trio of interfaces ...

 interface Mammal {}
 interface Dog extends Mammal {}
 interface Cat extends Mammal {}

And another interface to be proxied by AltRMI ..

  Mammal getMammal(String mammalName);

If a particular server side impl were to return an instance of Dog to 
the client it would not currently be castable from Mammal to Dog upon 
receipt.  This needs fixing.

I think in PublicationDescriptor and the 'altrmiproxies' taskdef  we 
need to optionally indicate which that X may not be the most derived 
type for certain return types.  In this case X is Mammal and the more 
derived types are Dog and Cat.  Here are some thoughts, expressed as 
rewritten altrmiproxies classes:

    <altrmiproxies genname="Farm" srcgendir="${build.home}/genjava" 
classgendir="${build.home}/genclasses" verbose="true" interfaces="pkg.Farm">
        <additionalfacades>
          <facade interface="pkg.Mammal" subinterfaces="pkg.Dog, pkg.Cat"/>
        </additionalfacades>
    </altrmiproxies>

or...

    <altrmiproxies genname="Farm" srcgendir="${build.home}/genjava" 
classgendir="${build.home}/genclasses" verbose="true" interfaces="pkg.Farm">
        <additionalfacades>
          <facade interface="pkg.Mammal">
             <subinterface interface="pkg.Dog"/>
             <subinterface interface="pkg.Cat"/>
          </facade>
        </additionalfacades>
    </altrmiproxies>

It would be stretching my Ant capabilities to the limit to do the above 
nesting, but what the hell ;-)

Thoughts anyone ?

Regards,

- Paul H


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message