Consider the very simple IDL code that specifies a base and derived interface in CORBA:
module test{
interface Quote{
attribute string symbol;
};
interface SpecialQuote:Quote{
attribute string specialSymbol;
};
interface QuoteSender{
void sendQuote(in Quote stock_quote);
}
};
(This assumes CORBA but should be similar for other middleware). I am interested in being able to:
- create a derived class "SpecialQuote", fill in specialSymbol
- upcast to the base class "Quote", fill in symbol
- send over CORBA interface using "sendQuote"
- on the receiving end, downcast to SpecialQuote to retrieve specialSymbol
I'm having a hard time performing this because the attributes essentially just translate to empty setters/getters in Java rather than their Primitive Data Types. Thus it requires both the client and server ends to re-implement the setters/getters.
So in short, is inheritance of interface members possible across middleware? If so in CORBA, any recommendations? If in another middleware, which one?