Re: Bag IDL



Hi Mike,

On Mon, 19 Feb 2001, Mike Kestner wrote:
> And my point is that there is no reference in the IDL to how these
> type and subtype are defined and used with regard to property related
> events.  It's RTFS to find the buried API.
  
        Yes, this sucks - we need better documentation, I think perhaps we
overengineered the textual naming there, however, it is neccessary that we
can attach listeners to sub-event streams by name.

        I think the OO solution is to pass:

        struct {
                string prop_name;
                Any    value;
        };

        There was some fear of the Any interface IIRC, so we didn't do    
this ( a mistake as you point out ).

> interface PropertyListener : Unknown {
>       void changed (in string prop_name, in any value);
> }
>
> Compare the readability of this to what we have now.

        It is better to build good generic infastructure than a lot of
special case interfaces that will turn out to be unmaintainable and go and
breed in dark places in other projects - we tried this model in evolution
and we have umpteen slightly different, wierd listener interfaces.

> 1) Encode it as a struct and bury that in an any, which I believe
> means I have to create a CORBA_typecode for my new event structure.

        The IDL compiler will generate the code that builds the typecode
for you, it will also specify the contract nicely in the IDL eg.

module Foo {
        struct MyEvent {
                long whatever;
        };
};

        will cause the TC_Foo_MyEvent typecode to be usable from your code
- manual TypeCode construction is evily difficult - I share your horror of
that :-)
  
>  The any that arrives on the client side won't be automatically
> demarshalled into a C structure, either, correct?
 
        No, it should be, you should be able to cast your any->_data to
struct Foo_MyEvent * and dereference it just fine.

> 2) Store the name and objref into separate any's, stuff them into an
> AnySeq, and stuff that into an Any.

        There were some serious IDL compiler bugs with sequence<any> last
time I looked at it, such that very wierd things happened. No-one showed
any interest in fixing them either it seems.

> >         I believe the decision to go with a standard event source /
> > listener was the correct one.
>
> I think it has a lot of potential, and I feel like I put in a serious
> attempt to use it for my project.  Perhaps I'm a moron, but going into
> the above effort, I thought I had a decent understanding of how
> CORBA_any's worked.
          
        Please ask, please ask sooner rather than later. You wasting 4
hours is bad news for everyone, Dietmar and I are here to help :-)

>  Until BonoboArg's are beefed up by someone smarter

        As you know a BonoboArg == CORBA_Any :-) there is of course the
DynamicAny_ interface ( ORBit/src/orb/dynany.h ) that provides a nice way
to use Anys.
 
        Regards,

		Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]