Prop and Event Conventions (was Re: GNOME::Selector)



On 31 May 2001 14:05:32 -0400, Michael Meeks wrote:

>         bonobo_pbclient_setv (
>                 obj,
>                 "mime_types", TC_CORBA_sequence_CORBA_string, &mime,

Are we adopting some property and event naming and documentation
conventions for the 2.0 platform?

OpenOffice uses a "MimeTypes" StudlyCaps convention for naming their
properties. It's also unclear currently how to document the available
properties and events for a given collection of interfaces.

Instead of just whining about it, I'll propose the following as an
example contract.  It extends the OO service concept to include event
specification, since they seem to have adopted a specialized listener
paradigm instead of a generalized ESource.  Whether we ever migrate to
UNO or not, it seems logical to adopt a similar convention and extend it
to our needs. I'm not sure where to install this info, with the oaf file
or the idl files.
 
module GNOME { module Draw {
    service ShapesContract {
        interface GNOME::Draw::Shapes;
        interface Bonobo::PropertyBag;
        interface Bonobo::EventSource;
        interface Bonobo::PersistStorage;

        [event] shape_added (ShapeAddedEvent add_event);
        [event] shape_removed (string shape_name);

        [property] long ShapeCount; // Just for example
    };
}; };

Having something like this, even if it's not hooked into oaf activation
in 2.0, would help new users avoid the pain of rummaging through code to
determine the hidden API for components using PBags and ESources.

Mike






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