Re: [Zope-dev] Implementing ZPattern: Containment

2001-03-21 Thread Steve Spicklemire


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

2001-03-06 Thread Johan Carlsson

> 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

2001-03-06 Thread Steve Spicklemire


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

2001-03-06 Thread Johan Carlsson

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·§r‡bž^•«^vX¬¶Èm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥æ§ž‹§qèm¶Ÿÿ–+-³:)zŠàþf¢–f§þX¬¶)ߣüè¥