[Zope-dev] Implementing ZPattern: Containment

Steve Spicklemire steve@spvi.com
Tue, 6 Mar 2001 09:58:17 -0500 (EST)


Hi Johan,

   Have a look at http://www.zope.org/Members/sspickle/DumbZPatternsExample

The best way I've found is to provide a method (or methods) in the 
Specialist of the contained item to get ids of those instances satisfying certain 
criteria... 

e.g., getToDoIdsForDoer( aDoer )

(the contained item keeps a reference to the id of its container.)

-steve
>>>>> "Johan" == Johan Carlsson <johanc@torped.se> writes:

    Johan> Hi, How could containment be implemented with ZPatterns.

    Johan> Container -n-----1- ContainedItem -n-----1-
    Johan> ContainedSubItem

    Johan> I suppose there would be a Containter Specialist containing
    Johan> a ContainerItem Specialist.  But Specialists retrieve
    Johan> objects by IDs so there would also be a list of
    Johan> ContainerItem ID in the Container object.

    Johan> Are there any other way to do it, for instance keeping a
    Johan> list of object references that would be retrieve from the
    Johan> ContainerItem Specialist by a attribute provider in the
    Johan> Containter Specialist? But I still need the list of IDs
    Johan> don't I or how else would the ContainerItem Specialist know
    Johan> what objects to return?

    Johan> TIA, Johan Carlsson
    Johan> ٢
j)ef^7:){+m+-j)fjb?Ί^ׯhr,,+3zw(v)EZelm+-j)fjb?Ί^zm+-j)fjb?Ί^