Thanks to all who responded. My linked list was going to store workflows for a document processing application. I can certainly store it in a set of records with integer attributes for ordering, but will of course have to write the functionality of inserting and deleting steps.
To try and help the next newbie out, I wrote a wiki page to introduce WO and order all of the reference documents I have used so far to learn WebObjects clean (with no knowledge of v5.3 or prior). It is parked at
http://wiki.objectstyle.org/confluence/display/WOL/Learning+WebObjects. I haven't linked to it though, if someone smarter than me could proof read it and link it to the WOProject homepage I think it could be helpful.
Tavis McDevitt
From: Chuck Hill <email@hidden>
To: Tavis McDevitt <email@hidden>
Cc: email@hidden
Sent: Sun, October 25, 2009 3:40:25 AM
Subject: Re: Webobjects-dev Digest, Vol 6, Issue 949
On Oct 24, 2009, at 4:38 PM, Tavis McDevitt wrote:
> Don:
>
> As someone who is learning WO I can honeslty say I would have looked at your tutorials sooner if I'd known about them. They're a great addition since the best intro material I've seen so far is Apple's documentation (I've read all of it and it is still really useful and conceptual), and you help bridge the gap between thier use of deprecated tools and WOLips. (When I was done with that Chuck's
book became very useful too.)
>
> I've a question though. In your EoModelerBasics show, you made a to-one relationship from a Person entity to a Cadency entity (a title, like Jr or Sr).
I learned a new word today. :-)
> I get it. You also made the inverse to-many relationship from Cadency to Person. I don't get that. If I assume that I will never traverse an inverse relationship (I will never want to know what people have a Jr in their signature), do I have to model the inverse relationship? I've been skipping that.
To clarify what Miguel said, I would never model that particular relationship. If you every need it, you can just fetch them. If you model this, once you get up to tens or hundreds of thousands of row, doing an addObjectToBothSidesOfRelationshipWithKey is going to fetch a LARGE number of rows for no reason.
For things like, er, Cadency, I'd consider NOT modelling it at
all. I think Wonder has some magic to turn codes (e.g. 0, 1, 2 etc.) into POJO when you fetch.
> One more question while I'm at it. What's the best way to model a linked list? I've thought of putting list items in a table with an inbred relationship that links to other list items. My concern is that to retrieve the list at once I'd have to have many trips to the database, because in a single fault I will only know the root item in the list, and after each succesive fetch will only have a reference to one more item. I don't know much about stored procedures; can one be written to fetch the entire list?
I've used self referencing relationships before, but not for a linked list. I've only used them when I could fetch all the data at once or when the relationships only went a few levels. As you point out, more than that will cause performance problems. If list order is your concern, then Miguel gave you a
good answer. If you are after something else, we will need more details.
Chuck