[Seaside] isolate: not working properly

Avi Bryant avi at beta4.com
Wed Sep 22 14:12:23 CEST 2004


On Sep 9, 2004, at 11:36 AM, Avi Bryant wrote:

> Incidentally, I'm not sure why you need a solution this complex.  
> Instead of replacing Main and RenderLoop, just use a subclass of 
> WATask as your root component, with this #go method:
>
> ChildrenTestTask>>go
> 	self authenticateWith: self during: [self call: 
> (ChildrenTestRootComponent new)]
>
> That doesn't fix the problem, but it does provide a more minimal test 
> case for it.
>
> I may not have time to look into this more until next week.

Or, as it happens, the week after...

The problem, ultimately, is that I'm lazily initializing the 
"decoration" StateHolder in WAComponent.  I knew this was risky, but 
had convinced myself that it would always work.  But you found a case 
where it didn't; thanks.  Lesson: *never* use lazy initialization for 
StateHolders, even if you think you know what you're doing.

What this means, however, is that WAComponent needs to do explicit 
initialization.  I've never been very comfortable with patterns for 
doing this in classes that are widely subclassed - I can put the 
initialization of decoration inside #initialize, but that means that 
all subclasses with #initialize have to make sure to do the super send, 
and not only are there hundreds of component classes out there that 
don't do this and would have to be updated, but I suspect even after 
the change there will be hundreds more where people forget to do it.  
So what I've got now is:

WAComponent class>>new
	^ self basicNew initializeDecoration initialize

But that doesn't feel like a great solution either.
Comments?

Avi



More information about the Seaside mailing list