[Mono-list] Some news about a CORBA ORB implementation for.Net
framework
Jonathan Pryor
jonpryor@vt.edu
25 Sep 2002 21:27:20 -0400
On Wed, 2002-09-25 at 18:49, Miguel de Icaza wrote:
> > some "bits" like the IIOP encoding, but it is doubtful how useful that
> > > really is.
> > >
> > > The in-proc features are cool, but it would need things to be
> > > implemented with the ORBit model in mind, and not with a C# mind set.
> >
> > How else would we acomplish binding of bonobo objects?
>
> There are two ways of integrating with Bonobo:
>
> * At the binding level, just be a user, and not an
> implementor: Use Gtk# to produce the binding
>
> * At the interface-level, a pure Bonobo# implementation
> would have to implement the Bonobo interfaces and a set of
> the helper functions.
>
> Miguel.
Uh, yuck? Let me get this straight: if I want to implement Bonobo CORBA
interfaces from C#, I'll have to manually implement Bonobo::Unknown (or
use helper functions that in turn implement Bonobo::Unknown). Again, I
say: yuck.
This is where Bonobo use should follow COM-interop, as COM and Bonobo
are similar models
COM-interop has two parts. The first part allows .NET classes to use
COM objects. This would be equivalent to using Gtk# to produce a
binding, as you suggested above.
The second part allows COM objects to call .NET objects. See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconexposingnetframeworkcomponentstocom.asp
The summary is that when a COM application creates a COM object which is
actually a .NET object, it doesn't get the .NET object. It gets a "COM
Callable Wrapper" (CCW), which handles the mundane issues of IUnknown,
such as QueryInterface (easily handled through run-time type checking),
AddRef, and Release, all of which have equivalents in Bonobo::Unknown.
This makes it very clean for a .NET object to implement a COM
interface. The .NET object doesn't worry about
IUnknown::QueryInterface; the CCW can handle it. Ditto for
IUnknown::AddRef and IUnknown::Release. The .NET object is garbage
collected; why would it care about the reference count, anyway?
For more information on COM Callable Wrappers:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcomcallablewrapper.asp
What mono needs is a Bonobo Callable Wrapper. :-)
The downside to this approach is that it requires runtime support, which
is likely preferable to developers who need to inter-operate with Bonobo
objects.
- Jon