Polymorphism

From the outset, CORBA was intended to provide strong support for object-oriented programming concepts. Polymorphism is, therefore, one of the fundamental features of CORBA. The following are some of the object-oriented features supported:

  • Inheritance of interfaces, including multiple inheritance

  • Polymorphism

The IDL module Zoo, given in Listing 5.2, is used here to illustrate the features of inheritance and polymorphism.

Listing 5.2. The IDL for Module Zoo
// IDL #pragma prefix "pure-corba-3.com" module Zoo { interface Animal; typedef sequence<Animal> AnimalSeq; typedef sequence<string> StringSeq; interface ZooManager { AnimalSeq getAllAnimals(); ... }; // Base Interfaces interface Animal { readonly attribute string species; readonly ...

Get Pure CORBA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.