[Zope3-dev] Moving from custom indexed collection to Zope3...

Mike C. Fletcher mcfletch@rogers.com
Thu, 09 Jan 2003 08:04:02 -0500


Steve Alexander wrote:

> Hi Mike,
>
> I don't have the time to fully digest what you're saying here, but 
> I'll try to point you to the right places so you can answer your 
> questions. 

No problem, short of time myself :) .

>>    * I would need to modify the ObjectHub object itself to use
>>      something other than "location" for storing pointers to objects...
>>      seems like I must be misunderstanding:
>>          o Does ObjectHub actually just store paths, rather than ZODB
>>            object identifiers?
>
>
> Its purpose is to maintain a mapping of object hub id (hubId) to path 
> location. It should maintain this mapping even when objects are 
> deleted or moved.
> Not all objects are registered with the object hub. Which objects are 
> registered is a policy decision -- you need to write a component that 
> registers the objects that are important to you.
> The maintenance of the hubId<-->location mapping depends on 
> appropriate ObjectEvents being published by your objects or the views 
> / adapters on your objects.
> The ObjectHub generates hubIds randomly. There is no notion of 
> monotonicity. You could write your own subclass of the ObjectHub that 
> generates ids monotonically.

No reason.  Basically, the idea of "place" just isn't something I want 
in my code (my objects all manage their own life-cycles, so they want a 
"space" in which to live which is basically just a flat collection), so 
ObjectHub isn't the thing I'm looking for.  Thank-you for confirming that.

<snip clarification of events in ObjectHub>

> A folder needs to have unique names for its subobjects so that the 
> subobjects can be traversed to.
> Your objects need to be uniquely identified by a path, if you want 
> them to be traversed to. If you have non-unique ids then it is not 
> clear how you would traverse to a particular object.
>
> The setObject() method of the IContainer interface allows a container 
> to select an id for an object newly added to it.

Okay, will look into IContainer.  Thanks.
...

>> my assumptions about the nature of ObjectHub were incorrect.  I still 
>> haven't come up with what it is in Zope3 that does provide 
>> indexed-attribute support.  I know about IndexedCatalog by Async Open 
>> Source, but I had been under the impression that Zope included a 
>> similar system.  That impression may have been wrong...
>
>
> Can you explain what "indexed-attribute support" is?
>
> Perhaps the Query service, due to land RSN, will help there. 

Allows (fast) queries such as:
    find all objects of type Event with Event.startTime < todayEnd and 
Event.stopTime > todayStart
    find all objects of type Resource with naturalOrder > 3 and < 20 
(slice of a natural order index)
    find all objects which have indexed-text including "Peterson" (i.e. 
objects as documents have certain of their string fields indexed and are 
returned in response to the query)

Will look into the Query service when I'm back to the business software.

Okay, back to OpenGL now,
Mike

_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/