[Biojava-l] Corba

Matthew Pocock mrp@sanger.ac.uk
Thu, 10 Feb 2000 14:46:28 +0000


Ewan Birney wrote:

> Matt - Aren't you making life too difficult for yourself. Why doesn't
> this work:
> The servant ......_implBase (is a BioCorba.Seq)
>             inherited by org.biojava.biocorba.SeqImpl
>             which has-a  org.biojava.Seq interface object
> I count one object you have to write which inheriets from the CORBA
> servant and delegates to biojava interface.
> This object is also where you do the ref counting.
> Does this not work? Am I missing something?

This is what I thought initialy. *But*

_XimplBase implements the corba X interface, and inherits from a class to
provide the corba behaviour. In Java we only have one inheritance slot,
so If I inherit _XImplBase into _XImpl then I could not then inherit from
any base class Impl (like the gnome servant). Also, I can't do things
like inherit _SeqImplBase from  _GNOMEImplBase, as the automaticaly
generated corba code would blow chunks & not work out (one CORBA peer
would be created for each object for each interface it inherits directly
or indirectly). Trust me. It doesn't work.

Using the scheim I outlined, you can let the corba side look exactly like
normal corba, have a layer of script-generated glue, and then write a
thin interface implementation by hand within which I can inherit GNOME
into PrimarySeq, and PrimarySeq into Seq. By passing the _tie object in
as first argument, the Impl class has access to the corba layer as if it
subclassed a corba object, but is free to inherit from another class.
Sort of like passing the $self reference into perl object methods but
more like passing a $delegate, $wrapper pair in to a delegate method from
a method call forwarder in a wrapper.

If it worries you, have a look at the code. If there is an easier way to
do it, then show me.

> -----------------------------------------------------------------
> Ewan Birney. Mobile: +44 (0)7970 151230
> <birney@ebi.ac.uk>
> -----------------------------------------------------------------
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l