[Seaside] Some questions about Seaside architecture

goran at krampe.se goran at krampe.se
Tue Dec 13 07:11:49 CET 2005

Hi folks!

tim Rowledge <tim at rowledge.org> wrote:
> On 12-Dec-05, at 10:36 PM, Lukas Renggli wrote:
> >
> >>>>      * Are Seaside sessions serializable? Are closures  
> >>>> serializable in
> >>>> Smalltalk?
> >>>
> >>> No. And it is certainly not easy to do, because a closure might
> >>> reference the whole image; however if somebody is willing to invest
> >>> time and/or money this could be possible. In Smalltalk one can do
> >>> everything ;-)
> >>
> >>  I think serialization is quite crucial for fail-over clustering and
> >> long-term sessions, isn't it? For instance, Java Servlet API allows
> >> session serialization.
> >
> > I agree that this would be nice. As Avi mentioned, the easiest thing
> > to do right now is to save the whole object memory.
> Hmm, how about using the ImageSegment stuff? It's sort of saving the  
> whole image but with blocks to stop you saving the whole image. If  
> you see what I mean. I haven't done a lot with them but some  
> experiments for loading fonts during the exobox project showed it to  
> be really fast.

I have been using ImageSegments quite a lot - both in SM and in my own
web apps like HomepageBuilder. In short ImageSegments are *really* fast
to load but incur a full GC when being saved - which gives the save
operation a bit of overhead of course.

For an app with a "document model" (like eToys) or an app which can live
with checkpointing instead of full transaction logging (SM does this) -
they are pretty nice to use.

The "nice" thing with ImageSegments is of course that they don't use
serialization - instead they save a piece of object memory "as is". An
ImageSegment is wrapped in a RefStream though in order to deal with the
outpointers in a proper way.

There is information on the Squeak Swiki about how to use ImageSegments
"manually" like this and generally they work very well. I haven't tried
using it for "exotic" objects like Processes or Blocks etc, I guess that
doesn't work.

Today the obvious alternative is to use Magma and if I would start a new
project this day then I would definitely opt for Magma instead of
ImageSegments for persistence - there are tons of advantages.
ImageSegments are still outstanding as a delivery mechanism (as in SM) 
though, since they load so darn fast and are quite battle proven
(Projects use them it internally, which in turn means that eToys relies
heavily on them).

regards, Göran

More information about the Seaside mailing list