Last month, the hockey team I play hockey with in a (low key) league, asked me to setup a website where players could register and mark themselves as "Available", or 'Not Available', so we can keep track how many players can make it for the next game, and someone does not have to spend time counting email responses before calling substitutes if too few players can make it.
While the user interface for such website is simple, websites that maintain persistent data are not completely trivial, for the simple fact of having to introduce persistence.
I decided to use Seaside for the job and I have to say, it was a super-pleasant experience from the start to the end!
I have not looked at much Seaside code before, and it took two late nights (about 15 hours), much of which was to learn seaside basics and then figure out how to force KomHttpServer load images. The result is a decent looking functional site with persistance, that already served the team well and helped us not to miss any games short of players.
To get the a few things out of the way, the code is not a pinnacle of software engineering, but is was not intended to be. The main thing I do not like the entanglement of "application code" and user interface I end up with in my HockeyWebsiteWAComponent>>renderContentOn:. But the business code amount to a few lines of code and I just wanted something simple, so I am excusing myself, and next will be architecturally sounder.
Apart from that, everything was very simple. While working on it,
David Shaffer's Seaside Tutorial here.
The Seaside main site.
The tutorial linked from the above site.
WAAbstractHtmlBuilder
WAHtmlRenderer
A few comments at the end:
==========================
a) I used Seaside 2.5, and when writing the html the HTML code kept going a bit mure cluttered then I liked, yet on Google I kept coming up with results that showed more elegant API that would not clutter. I think this is Seaside 2.6, so anyone reading this about to learn Seaside I think it makes sense to start with Seaside 2.6 http://www.seaside.st/Download/Images/
b) It would be good to have a (x)html to Seaside converter. One reason is that some companies designers use html/css to for initial design, expecting the resulting page will use the html code they created.
c) You can look at the site (with removed players personal info) is here.
d) Notes on how to create and run the application
e) The classes can be downloaded here:
HockeyWebsiteWAComponent
HockeyPlayers
Utilities (persistence)
HockeyPlayer
GameDates
Hope this helps .. and I had to share how good Seaside on Squeak is :)
No comments:
Post a Comment