I suspect that as you work on the application you&#39;ll run up against issues like Albums that have more than one Artist. You&#39;d probably handle that by naming the instance variable on your Album class as artists rather than artist and have it hold a collection. Many, if not most, albums would just have a single Artist element in that collection but you&#39;d be able to accommodate more when needed.<br>
<br>In fact, you might even want to go down to the Track level before you assign an instance variable to hold the artist(s). The Album, which would no longer have an artist(s) instance variable would have a tracks instance variable to hold all of its Track instances and the Track class would have an artists instance variable to hold the appropriate Artist instance(s) associated to that Track.<br>
<br>In that case, one way to get the artists on a particular Album would be to implement a convenience method that iterates over all of it&#39;s tracks, collecting each Track&#39;s artists into a Set to remove the duplicates (most tracks on a given Album would usually - but not always - have the same artists).<br>
<br>As noted by others in this email chain, all of these relationships are controlled by the instance variables without the need to resort to dedicated key fields.<br><br> <br><br><div class="gmail_quote">On Thu, May 14, 2009 at 4:33 PM, Sean Allen <span dir="ltr">&lt;<a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
On May 14, 2009, at 9:58 AM, sergio_101 wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<br>
just relate the objects in instance variables. In collections when N and one<br>
when one :)<br>
</blockquote>
<br>
so, in albums, i would have something like artistID?<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
In a second phase you make convenience methods so they talk each other so they<br>
answer what you need.<br>
</blockquote>
<br>
is there something like the rails &#39;find&#39; function build in? so i could do something like..<br>
<br>
Album.find(albumID).artist<br>
<br>
</blockquote>
<br></div>
you dont need a find.<br>
<br>
create your domain objects so that artist is an instance variable of album<br>
<br>
when you have the album, just send it an artist message or perhaps isBy or whatever<br>
<br>
artist := album artist<br>
or<br>
artist := album isBy<br>
<br>
in your case, you dont ever need an id.<br>
<br>
you have Artist, Album, Songs<br>
<br>
if you want to find all albums by an artist,<br>
you could either have a persistent collection of artists that you go through, find the artist you are interested in and do something like:<br>
<br>
albums := artist albums<br>
<br>
or you could just maintain a persistent collection of albums and go through those, asking each who it was by.<br>
<br>
the options are pretty wide open,<br>
if you are using gemstone and have a ton of data, they provide special methods to make querying faster than iterating over a collection,<br>
but in the beginning, iterating over a collection would be your first step. ( iterating is a bad choice of words but you get the idea ).<div><div></div><div class="h5"><br>
<br>
<br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br>