optional methods?



I'm writing a corba api which has a bunch of callbacks, all of which are
optional. I don't want the implementation to have to provide a bunch of {}
methods (and I don't want the overhead of invocations that do nothing).

I put them all in an interface, and using the python binding I'm able to
implement just one or two of the callbacks and activate the object w/o problem.

I didn't find in the spec any mention of cases like this -- what in C would be
a null function pointer for an unimplemented callback.

Anyone know if this is considered ok? Or is it specific to orbit or python that
this works at all?

I guess I could implement an empty interface, make all the callback interfaces
inherit from it, and the implementations would inherit from all of the
callbacks they implement. Then I'd need to use some run-time "is-a" sort of
tests to extract which callbacks were implemented. 

b.c.



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