I have a list of things (an address book), and I'm writing a simple Seaside app to display the list and CRUD entries. I have a bunch of basic, related design questions. Any help will be greatly appreciated. There are a lot of questions here; answers like "go read XXX" would be just as helpful as direct answers. I have read the few Seaside tutorials and docs I've been able to find.
Who should "own" the list of entries? Should I create the list as a class instance variable of the entry class, or as a global entry in Smalltalk?
How should my WAComponents access the list: by holding a copy (won't modifications to the list will be lost?) or by asking for the class instance variable/Smalltalk entry every time they want to access the list?
What should I register for backtracking: the list itself? Each of the list entries?
I'm looking at WATableReport, but I'm a bit confused about how to hand it my list of entries. Do I need to create WAReportColumn objects for each instance variable of each entry?
Are these even the right questions? :-)
Thank you for your help.
Jim
On Fri, 29 Oct 2004 11:17:22 -0400, Jim Menard jimm@io.com wrote:
I'm looking at WATableReport, but I'm a bit confused about how to hand it my list of entries. Do I need to create WAReportColumn objects for each instance variable of each entry?
In case you missed it, there is a WATableReport tutorial at http://www.beta4.com/seaside2/docs.html.
Yar Hwee Boon wrote:
On Fri, 29 Oct 2004 11:17:22 -0400, Jim Menard jimm@io.com wrote:
I'm looking at WATableReport, but I'm a bit confused about how to hand it my list of entries. Do I need to create WAReportColumn objects for each instance variable of each entry?
In case you missed it, there is a WATableReport tutorial at http://www.beta4.com/seaside2/docs.html.
I had missed it. Thanks for the pointer. I have a lot of reading to do.
Jim
Quoting Jim Menard jimm@io.com:
I have a list of things (an address book), and I'm writing a simple Seaside app to display the list and CRUD entries. I have a bunch of basic, related design questions. Any help will be greatly appreciated. There are a lot of questions here; answers like "go read XXX" would be just as helpful as direct
answers. I have read the few Seaside tutorials and docs I've been able to find.
Who should "own" the list of entries? Should I create the list as a class instance variable of the entry class, or as a global entry in Smalltalk?
A pattern I have used in the past is to create a class the represents my data, like the Entries class you mention. I'll put a class side variable that will hold the data, and make accessor methods to get at the data:
Entries list do: [blah...]
then in my Seaside session, I would create an accessor that hides that:
MySession>>entries ^ Entries list
so in the rest of the app you are doing things like:
self session entries add: anEntry
Later, you can switch to using a GOODS database or some other db to store your entries, and as long as you protocal for adding and deleting entries doesn't change, your web app won't have to change a whole lot.
For example, if you have:
Entries>>addEntry: anEntry
Entries>>deleteEntry: anEntry
you can hide whether it's implemented as a simple Collection or as something else.
Brian
seaside@lists.squeakfoundation.org