[SqueakDot] Latest news

goran.hultgren at bluefish.se goran.hultgren at bluefish.se
Thu Jan 31 15:32:41 UTC 2002


If you are not interested in SqueakDot - stop reading now.
---
Ok, I am just in the process of packing it up for posting to the list.
It will be a bunch of Changesets for 3.3a 4664.

I have tried to remedy some problems with my approach and the results
can be seen by comparing the old:

http://marvin.bluefish.se:8080/squeakdot/srcnewaccount

...with a new version:

http://marvin.bluefish.se:8080/squeakdot/srcnewaccount2

The difference is that the last version uses an instance of HtmlBuilder
to produce the page. It's a little bit niftier than it looks actually.
:-) The builder just adds up Strings, Symbols and Blocks in an
OrderedCollection. It also keeps track of values for variables and so
called blockvariables. When #contents is called it streams over the
OrderedCollection and substitutes Symbols for values (variables) and
Blocks for their values.

A few advantages:

1. HTML production is now more or less up to the builder. It could do
all kinds of fancy things like weaving stuff into a template etc. The
calls to #html: could then be ignored or something.
2. We stream instead of concatenate which pays off in performance a bit.
3. Each field is actually only named in one place (unless you need to
set values to them). Pretty slick.

I intentionally kept the "rule" that the method takes the request as an
argument and should return a String with the HTML - you know, it's
simple and thus nice. This way both of these techniques can live happily
together. Anyway, it feels neat, and I hope it isn't too tricky to use.
I will start to convert pages one by one to try it out.

regards, Göran

PS. ChangeSets coming soon... DS



More information about the Squeak-dev mailing list