[omniORB] Inheritance of interface implementation classes?

Duncan Grisby duncan at grisby.org
Thu Jan 10 16:55:53 GMT 2008


On Thursday 10 January, Martin Trappel wrote:

> When I have two interfaces:
> - - -
> interface A {
>    void hello();
> }
> 
> interface B : A {
>    void world();
> }
> - - -
> 
> Is it a good idea with omniORB to also inherit the implementation
> classes, i.e.:

It depends on whether that's sensible for your application or not. If
you want to share implementation details then yes; if you don't, then
no.

> class A_i: public POA::A {
> ...
> };
> 
> class B_i: public POA::B, public A_i {
> ...
> };
> 
> Does this work without problems?

Yes, as long as you use virtual inheritance rather than non-virtual as
you have used above.

> Any pointers where such things are discussed?

Henning and Vinoski's "Advanced CORBA Programming with C++" is the best
resource.

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list