Re: Bonobo::ItemContainer changes in 0.31 to 0.32



Hi there,

On Wed, 24 Jan 2001 monkeyiq dingoblue net au wrote:
>   I notice that the method
>       ObjectList enumObjects ();
>    Has dissapeared from ItemContainer in 0.32+ of bonobo in favour of
>       ObjectNames enumObjects ();

        Correct.

> Before I changed some of my code that used the old method to use the
> new level of indirection, I was thinking about the efficiency of the
> new method.

        The method was changed for several reasons; mainly that the item
container is not just a collection of objects but primarily an association
of names and objects.

        The old enumObjects method didn't do anything to help express
this, indeed it returned a list of unnamed objects which was not really   
useful for what the item container was designed to do. It is designed to
help make things like:
  
        Give me 'Sheet1' from the spreadsheet collection, or 'Chart2' or
somesuch.
  
>     With the new solution I would have to get all the object names
> (which I think would require a transfer of more data than getting all
> the references), and then call getObjectByName() for each reference.
> Thus I would conclude that using the new interface for my existing
> design would cripple the speed of the already slowing application.
 
        Quite possibly. It is possible that we need a method to enumerate
all the object references in a sequence, however this structure is not
designed to store simple lists of objects. Nor is the object iteration
interface a very good thing to use since objects can be dynamicaly created
by the getObjectByName method.

>     Perhaps my usage of this interface is not what the interface was
> designed for, in which case I will copy the 0.31 interface and make a
> local implementation for my application to continue to use. I though
> that before I stopped using the standard interface I would drop a
> line.
 
        I think that's likely; we could use a nice generic collection
interface in bonobo though; perhaps it's worth examining MS' interfaces to
see how they do this at the COM level.

> BTW is there a script that can change code that used the old
> enumObjects() into new API calls or does one do this change by hand.
  
        Nope; sorry, it is not really possible to write a script to do
this.

        Regards,

                Michael.

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





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