Single object implementing multiple interfaces

Single object implementing multiple interfaces

Post by Bj?rn W. Bjange » Tue, 23 Jan 2001 19:58:09



Hello, everybody.

Programming in Visibroker for C++ 4.1, how would you recommend enabling a
single C++-object to implement a set of idl-defined interfaces?

Would you use interface inheritance at the idl-level, multiple inheritance
from the generated POA skeletons, or the tie-mechanism?

The server implementation in question is part of a platform for telecom
services, communicating with several other servers through two way
interfaces. The treatment of received requests on all interfaces must be
done by one single component that can interpret their significance when
having the whole picture...

Thanks for your ideas!

Bj?rn W. Bjanger

 
 
 

Single object implementing multiple interfaces

Post by Kristopher Johnso » Wed, 24 Jan 2001 06:51:11


I find that doing it at the IDL level is simplest.  Multiple inheritance and
ties make things complicated.

-- Kris



Quote:> Hello, everybody.

> Programming in Visibroker for C++ 4.1, how would you recommend enabling a
> single C++-object to implement a set of idl-defined interfaces?

> Would you use interface inheritance at the idl-level, multiple inheritance
> from the generated POA skeletons, or the tie-mechanism?

> The server implementation in question is part of a platform for telecom
> services, communicating with several other servers through two way
> interfaces. The treatment of received requests on all interfaces must be
> done by one single component that can interpret their significance when
> having the whole picture...

> Thanks for your ideas!

> Bj?rn W. Bjanger


 
 
 

Single object implementing multiple interfaces

Post by Martin v.Loew » Wed, 24 Jan 2001 08:18:09




Quote:>Would you use interface inheritance at the idl-level, multiple inheritance
>from the generated POA skeletons, or the tie-mechanism?

The first and the last are good options. The second (MI) does not work.

Quote:>The server implementation in question is part of a platform for telecom
>services, communicating with several other servers through two way
>interfaces. The treatment of received requests on all interfaces must be
>done by one single component that can interpret their significance when
>having the whole picture...

In that case, it may be that you really need multiple interfaces (i.e.
a user of one interface should not need to work with the other). In theory,
this is what the CORBA Component Model gives you. In practice, you get
nothing but the spec - but it might still help doing it the CCM way (e.g.
with facets, and navigation between them if desired).

Regards,
Martin

 
 
 

Single object implementing multiple interfaces

Post by Michi Hennin » Wed, 24 Jan 2001 11:11:47



> Hello, everybody.

> Programming in Visibroker for C++ 4.1, how would you recommend enabling a
> single C++-object to implement a set of idl-defined interfaces?

You don't. Ever. It doesn't make sense to have a single servant implement
more than one IDL interface because it causes all sorts of ambiguities
with the C++ mapping. In other words, if you have:

        interface foo {};
        interface bar {};

then you cannot write

        class foobar_impl : public virtual POA_foo, public virtual POA_bar {
                // ...
        }

This simply doesn't work. What does work is to do something like:

        interface foobar : foo, bar {};

and to then write

        class foobar_impl : public virtual POA_foobar { /* ... */ }

Or, you can have two separate servant classes that delegate to a single
instance (which is *not* a servant):

        class myfoobarbehavior { /* ... */ }

        class foo_impl : public virtual POA_foo {
                // Delegate work to a myfoobarbehavior instance
        }

        class bar_impl : public virtual POA_bar {
                // Delegate work to a myfoobarbehavior instance
        }

Quote:> Would you use interface inheritance at the idl-level, multiple inheritance
> from the generated POA skeletons, or the tie-mechanism?

> The server implementation in question is part of a platform for telecom
> services, communicating with several other servers through two way
> interfaces. The treatment of received requests on all interfaces must be
> done by one single component that can interpret their significance when
> having the whole picture...

Sounds like the final approach is the correct one. If you have a single
class that can provide the behavior for operations on multiple, unrelated
IDL interfaces, then make separate servant classes for each IDL interface
and have them delegate to the single class that provides the behavior.

                                                        Cheers,

                                                                Michi.
--
Michi Henning               +61 7 3324 9633
Object Oriented Concepts    +61 4 1118 2700 (mobile)
Suite 4, 8 Martha St        +61 7 3324 9799 (fax)

Brisbane, AUSTRALIA         http://www.ooc.com.au/staff/michi-henning.html

 
 
 

Single object implementing multiple interfaces

Post by Bj?rn W. Bjange » Wed, 24 Jan 2001 17:45:32


Thanks for your advices. I've done some further work on my own as well, and
I think I'll go for using multiple inheritance at the IDL-level. Tie would
work nicely as well, but idl-inheritance is easier to model in Rose :)

We're using Rose 2001 for code generation...

Regards,
Bj?rn W. Bjanger



Quote:> Hello, everybody.

> Programming in Visibroker for C++ 4.1, how would you recommend enabling a
> single C++-object to implement a set of idl-defined interfaces?

> Would you use interface inheritance at the idl-level, multiple inheritance
> from the generated POA skeletons, or the tie-mechanism?

> The server implementation in question is part of a platform for telecom
> services, communicating with several other servers through two way
> interfaces. The treatment of received requests on all interfaces must be
> done by one single component that can interpret their significance when
> having the whole picture...

> Thanks for your ideas!

> Bj?rn W. Bjanger

 
 
 

Single object implementing multiple interfaces

Post by Joe » Thu, 08 Feb 2001 21:45:14


It sounds like you have a project that is well suited for the ORBacus
Notification Service.  I am not a fan of Visibroker and can assure you that
the products at www.ooc.com will blow them away in quality and support.  As
well, if this is a telecom project, the Telecomm Logging Service may also be
of interest to you.

As to your initial question, multiple inheritance from the generated POA
skeletons seems like the best solution.  However this is dependant on your
project.  It could be the tie implementation would work better for you.

joe



Quote:> Hello, everybody.

> Programming in Visibroker for C++ 4.1, how would you recommend enabling a
> single C++-object to implement a set of idl-defined interfaces?

> Would you use interface inheritance at the idl-level, multiple inheritance
> from the generated POA skeletons, or the tie-mechanism?

> The server implementation in question is part of a platform for telecom
> services, communicating with several other servers through two way
> interfaces. The treatment of received requests on all interfaces must be
> done by one single component that can interpret their significance when
> having the whole picture...

> Thanks for your ideas!

> Bj?rn W. Bjanger

 
 
 

1. Implementing a simple authorisation method on a single CORBA object

Hi,

I'm trying to implement a simple authorisation model where each interface
has an authorise method which needs to be called
before all other methods work (they throw exceptions otherwise).

The interface is along the lines of:

interface {
    authorise(key);
    do_this();
    do_that

Now this works as I know when authorise has been called. However there is a
single object here handled by the standard RootPOA using a single servant.
Question is once authorise is called *any* other client can come along and
call do_this() or do_that() and the object is already authorised. How do I
determine who the client is so that I can ignore all other clients?

Or is this just not the way to do things with a single object. Is the only
other way to move the authorise out to a seperate object, and make the above
interface a transient object returned by the authorisation object.

I was hoping that my simple single object could handle multiple clients
*and* be able to distinguish which clients had called authorise and which
hadn't.

Richard J.

2. accessing .NET dll from COM without adding to GAC?

3. Modelling associations to Classes that implement multiple interfaces (UML Question)

4. Viper V770 and Ensoniq PCI Card

5. public vs private access: implement two interfaces in same object?

6. Help: Toshiba XM-5302B on secondary IDE

7. How to register a object(DLL) implemented the IShellFolder interface?

8. FS/T Assorted Atari XL/XE items

9. How to get Multiple IP Addresses on a single interface under VxWorks

10. Controlling multiple DSP PCI interfaces with a single FDO using WDM.

11. Setting multiple objects via single SNMP set command

12. rendering multiple volume objects with a single model

13. multi-interface/single interface 82559 driver- LoPEC (motorola)