[Seaside] Re: Getting my project started from the ground up..
(using Seaside, Glorp, Mewa?)
yanni at rogers.com
Wed Feb 8 19:55:10 UTC 2006
Rick Flower wrote:
>> - To handle update of contact info, just create a contact object
>> corresponding to the form you want to show. Generate an UPDATE SQL stmt
>> from that contact object (the form processing should stuff the values
>> for you). Again, you might consider adding MEWA (and maybe Glorp)
>> at this point as well.
> Could this not be a method of a "User" object -- perhaps one method to
> the update HTML and another one to update the database object? I guess
> you've somewhat got my OO brain in gear now.. Any other options/opinions?
Create "User" as a POSTO (Plain-old-Smalltalk-object - my head
is still full of acronyms because I was at a Java/SpringFramework
presentation last night; the presenter talked on and on until the
security guard had the organizer usher us out).
Add getters and setters to the User class. Then you can use
#textInputOn:of: and similar methods to generate the HTML.
That's part of what Seaside gets you. For the price of learning
MEWA and writing its descriptors, you won't have to manually
code all the #textInputOn:of: stuff - that's part of what
MEWA would get you. Finally, for the price of learning GLORP
and writing its descriptors, you won't have to manually code
any CREATE/SELECT/UPDATE/DELETE sql - that's part of what
GLORP would get you.
If you want, you can use an abstract superclass for all your
model objects such as User. Here you could do the meta operations
such as generating the HTML and SQL. At a certain point, you
might decide that this is unnecessary because it was much more
straitforward to put specific code in each of the few domain
classes. Or you might decide that its pointless to reinvent a
MEWA and/or GLORP framework, and decide to invest energy into
using one or both. Or you might decide to continue to invest in
your own frameworks.
More information about the Seaside