Discussion:
Another beginner question: Can CORBA types be IDL attributes?
(too old to reply)
Navigateur
2010-08-23 08:41:50 UTC
Permalink
I have a little area of concern.

It would seem intuitive to me that you could define an IDL interface
using other IDL types as attributes, which would then expose their
methods to the client application (using ".") as well.

Is this possible? I haven't set up CORBA yet so I don't know. I'm just
in the planning stage.

For example (excuse my bad IDL):

interface Car{

attribute BrakePedal brakePedal;
//...
}

//then.. (place above)

interface BrakePedal{
void press();
//...
}

//...

Then in the client app, you could do: myCar.brakePedal.press();

CORBA would seem crappy if you couldn't do these kind of multi-level
objects. After all, real-world objects are multi-level, right? So can
someone put my mind at ease and confirm (or try) if this works?
Navigateur
2010-08-24 11:21:30 UTC
Permalink
I posted this question in stackoverflow.com as well.
Post by Navigateur
I have a little area of concern.
It would seem intuitive to me that you could define an IDL interface
using other IDL types as attributes, which would then expose their
methods to the client application (using ".") as well.
Is this possible? I haven't set up CORBA yet so I don't know. I'm just
in the planning stage.
interface Car{
      attribute BrakePedal brakePedal;
      //...
}
//then.. (place above)
interface BrakePedal{
      void press();
      //...
}
//...
Then in the client app, you could do: myCar.brakePedal.press();
CORBA would seem crappy if you couldn't do these kind of multi-level
objects. After all, real-world objects are multi-level, right? So can
someone put my mind at ease and confirm (or try) if this works?
Thomas Richter
2010-08-25 21:04:53 UTC
Permalink
Post by Navigateur
It would seem intuitive to me that you could define an IDL interface
using other IDL types as attributes, which would then expose their
methods to the client application (using ".") as well.
Is this possible? I haven't set up CORBA yet so I don't know. I'm just
in the planning stage.
interface Car{
attribute BrakePedal brakePedal;
//...
}
//then.. (place above)
interface BrakePedal
void press();
//...
}
//...
Then in the client app, you could do: myCar.brakePedal.press();
No, you cannot. Corba tries to offer language mappings to many
languages, amongst them non-OO-oriented like C that do not offer
attributes. Thus, you must do that differently - or rather "traditionally":

interface Car{

BrakePedal getBreak();
}

myCar.getBreak().press();

Attributes are just syntactic sugar, after all.
Post by Navigateur
CORBA would seem crappy if you couldn't do these kind of multi-level
objects.
Ehem. CORBA *is* crappy. (-; At least it is once you have seen the C++
mapping.
Post by Navigateur
After all, real-world objects are multi-level, right? So can
someone put my mind at ease and confirm (or try) if this works?
Not like you requested it. But, as everything, it can be simulated easily.

So long,

Thomas
Johnny Willemsen
2010-08-26 07:18:22 UTC
Permalink
Hi,
Post by Thomas Richter
Ehem. CORBA *is* crappy. (-; At least it is once you have seen the C++
mapping.
We have send a draft RPF to the OMG asking for a new IDL to C++0x
mapping, having a new C++0x language binding will make things much better.

Johnny
Bruce Visscher
2010-09-08 19:24:38 UTC
Permalink
Post by Johnny Willemsen
We have send a draft RPF to the OMG asking for a new IDL to C++0x
mapping, having a new C++0x language binding will make things much better.
That's great! Is the draft available for review? Any idea what the
chances are that it will be accepted?
Johnny Willemsen
2010-09-09 06:38:17 UTC
Permalink
Hi,
Post by Bruce Visscher
Post by Johnny Willemsen
We have send a draft RPF to the OMG asking for a new IDL to C++0x
mapping, having a new C++0x language binding will make things much better.
That's great! Is the draft available for review? Any idea what the
chances are that it will be accepted?
It is a draft RFP which asks for proposals, not a new IDL to C++0x
proposal itself. That is something we want to work on next year.

Johnny

Bruce Visscher
2010-09-08 19:13:22 UTC
Permalink
Thomas,
Post by Thomas Richter
Post by Navigateur
It would seem intuitive to me that you could define an IDL interface
using other IDL types as attributes, which would then expose their
methods to the client application (using ".") as well.
Is this possible? I haven't set up CORBA yet so I don't know. I'm just
in the planning stage.
interface Car{
      attribute BrakePedal brakePedal;
      //...
}
//then.. (place above)
interface BrakePedal
      void press();
      //...
}
//...
Then in the client app, you could do: myCar.brakePedal.press();
No, you cannot. Corba tries to offer language mappings to many
languages, amongst them non-OO-oriented like C that do not offer
I don't think this is correct.

The omniORB IDL compiler accepts this:

interface BrakePedal {
void press();
};
interface Car {
attribute BrakePedal theBrakePedal;
};

Note that names in a scope in IDL must differ by more than type. This
is to accommodate languages that are not case sensitive. It has
nothing to do with the C programming language or with being OO.

Bruce
Loading...