Re: [Zope-dev] Implementing ZPattern: Containment
Hi Johan, I wrote: > 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.) then you replied: > How well does this apply to the WhoIKnow pattern? > Could you say that the Specialist is the association? > In that case how do I create a n-n relation, or maybe I never do that? > I can't really find any Patterns that matches n-n situation, so I assume > it my modell probally would wrong if I end up with that, right? > > then I went on vacation. ;-) I think that in most of these situations you can have a 'catalogish' method in the Specialist that manages the 'n' things that finds those related to the '1'. (e.g., getToDoIdsForDoer( aDoer )). This can then be mapped to an attribute of the '1' specailist (myToDos), so that it does 'know' about all it's todos, its just that under the covers (in it's rack) the myToDos attribute is really fulfilled by calling the todos specialist and asking for all the todos assocaited with a particular doer. In the n-n case it's really no different, except that each 'n' thing needs to know which of the other 'n' thing(s) it's associated with so the catalogish method can pull out the ids. fun eh? take care, -steve ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Implementing ZPattern: Containment
> 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.) Thanks Steve, I like that because the container doesn't know about it's Content, but how does that comply to the Who I Know pattern? TIA/Johan h¥àÞ¾f¢X¬µ)x7¯Î^¢¸!¶ÚþX¬¶Ìè¥ê+ùYùb²Ø§~ó¢zóhrº,²,¶Ê+3zw(v)àEéZµçeËlÛiÿùb²Û3¢¨®æj)fjåËbú?Î^jyèºwÛiÿùb²Û3¢¨®æj)fjåËbú?Î^
Re: [Zope-dev] Implementing ZPattern: Containment
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 <[EMAIL PROTECTED]> 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)eËÿf^ü7¯ÿ:){ú+m§ÿÿ+-³üè¥ïè®æj)fjåËbú?Î^ýׯÿóhrº,²,¶Ê+3zw(v)àÿÿÿEéZµçeËlþm§ÿÿ+-³üè¥ïè®æj)fjåËbú?Î^ý©ç¢éÜzm§ÿÿ+-³üè¥ïè®æj)fjåËbú?Î^ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
[Zope-dev] Implementing ZPattern: Containment
Hi, How could containment be implemented with ZPatterns. Container -n-1- ContainedItem -n-1- ContainedSubItem I suppose there would be a Containter Specialist containing a ContainerItem Specialist. But Specialists retrieve objects by IDs so there would also be a list of ContainerItem ID in the Container object. Are there any other way to do it, for instance keeping a list of object references that would be retrieve from the ContainerItem Specialist by a attribute provider in the Containter Specialist? But I still need the list of IDs don't I or how else would the ContainerItem Specialist know what objects to return? TIA, Johan Carlsson f^ ëæj)eËY¢züè¥ê+m§ÿåËlÎ^¢¸?¨¥©ÿ+-wèÿ:)yׯ6+¢Ë)¢Ël¢±Ó0·§rb^«^vX¬¶Èm¶ÿ+-³:)zàþf¢f§þX¬¶)ߣüè¥æ§§qèm¶ÿ+-³:)zàþf¢f§þX¬¶)ߣüè¥