[Seaside] isolate: not working properly

Avi Bryant avi at beta4.com
Sun Sep 26 17:00:28 CEST 2004


On Sep 24, 2004, at 12:14 PM, radoslav hodnicak wrote:

> Sorry, but as developer I neither should nor want to care if some 
> internal
> things in the framework I'm using are initialized properly

Yes, although that's tricky when subclassing.  For example, I tend to 
do things like this:

MyComponent class>>field: aField
	^ self basicNew initializeWithField: aField

At this point,I *have* to know and care how the superclass 
initialization works.  Either I need to use #new here instead of 
#basicNew (which I dislike, since it often leads to 
double-initialization or initialization in the wrong order), or I have 
to send #initialize from #initializeWithField: to make sure that any 
inherited state is initialized properly.  All well and good, but if the 
decoration initialization is happening in some method other than 
#initialize, the usual patterns won't work for it - so I really do have 
to know.

The real question is how much code is going to break - currently, any 
code like the above breaks.  If I used #initialize instead of 
#initializeDecoration, a whole different set of classes would break.  I 
haven't yet come up with something where nothing will break... except 
possibly to put it in #initialize *and* lazily init it?  That way you'd 
still have the edge case bug if you didn't send "super initialize", but 
stuff would still mostly work.  Is that better or worse? :)

Avi



More information about the Seaside mailing list