Subject: Re: Maintaining multiple Collections
References: <3u5g5j$43t@noc.tor.hookup.net>
Date: Sun, 16 Jul 95 17:51:00 +1000     
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.sprintlink.net!simtel!harbinger.cc.monash.edu.au!news.cs.su.oz.au!tmx!steve
From: steve!steve(Steve Hayes)
Newsgroups: comp.lang.smalltalk
Message-ID: <07-16-1995.551@steve>
Followup-To: comp.lang.smalltalk
Lines: 18

In article <3u5g5j$43t@noc.tor.hookup.net> Dennis Smith <quenton@Cherniak.ON.CA> 
writes:
>Consider a Customer Order application in which we have
>     Customer
>     Order
>     OrderItem
>     Product
>
I agree with Curt. You have a many-to-many relationship between Order and Product. 
This can be externalised into an associative object, Order Item, so that neither of 
the objects involved in the M-M relationship knows about the others.

You may still want to stay with the collections. I assume that you have some method 
to add an OrderItem to the Order. I also assume that this is the method that adds 
the OrderItem to the collection in the appropriate Product. Use the converse 
approach for removing OrderItems. Have the Order update the appropriate Product.

Steve Hayes
