Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1020575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:11:01+00:00 2026-05-16T11:11:01+00:00

Before I start using CORBA I want to know something. It would seem intuitive

  • 0

Before I start using CORBA I want to know something.

It would seem intuitive to me that you could use an IDL type as an attribute of another, which would then expose that attribute’s methods to the client application (using “.”) as well.

But is this possible?

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
object interfaces. After all, real-world objects are multi-level, right? So can
someone put my mind at ease and confirm (or try, if you already have CORBA set up) if this definitely works? None of the IDL documentation explicitly shows this in example, which is why I’m concerned. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:11:01+00:00Added an answer on May 16, 2026 at 11:11 am

    Declaring an attribute is logically equivalent to declaring a pair of accessor functions, one to read the value of the attribute, and one to write it (you can also have readonly attributes, in which case you would only get the read function).

    It does appear from the CORBA spec. that you could put an interface name as an attribute name. I tried feeding such IDL to omniORB’s IDL to C++ translator, and it didn’t reject it. So I think it is allowed.

    But, I’m really not sure you would want to do this in practice. Most CORBA experts recommend that if you are going to use attributes you only use readonly attributes. And for something like this, I would just declare my own function that returned an interface.

    Note that you can’t really do the syntax you want in the C++ mapping anyway; e.g.

    server->brakePedal()->press();   // major resource leak here
    

    brakePedal() is the attribute accessor function that returns a CORBA object reference. If you immediately call press() on it, you are going to leak the object reference.

    To do this without a leak you would have to do something like this:

    BrakePedal_var brakePedal(server->brakePedal());
    brakePedal->press();
    

    You simply can’t obtain the notational convenience you want from attributes in this scenario with the C++ mapping (perhaps you could in the Python mapping). Because of this, and my general dislike for attributes, I’d just use a regular function to return the BrakePedal interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

before I start I want to point out that I tagged this question as
Before I start, I want to make it clear that my code is working
Why I can use setcookie without any preparation while need a session_start() before using
Am using Mediainfo library in my C# project,before start invoking this dll,i just ran
Before I start: I'm programming for Iphone, using objective C. I have already implemented
I want to get one record before start date and end date DtpFrom means
Before I start using Session State server for the benefit of making session state
I have downloaded the latest version of JFreeChart (1.0.14) and want to start using
I have a problem. Before we start using https I get previously Page using
Does anyone here use Spec# regularly? I would like to know if it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.