Seaside components within Pier, and their state.

Nick Brown nickbrown at fastmail.fm
Fri Dec 18 16:21:08 MET 2009


> Components are view and controller. If you have data that should
> persist across sessions, you should put it into a separate model
> object. Pier stores its model in the PRKernel instance, that refers to
> a tree of PRStructure objects, and others.
> 
> Cheers,
> Lukas

Ok. I've been looking at PBBlog and related classes for a few hints
about this. By all means shout out if I'm wrong about any of the
following:

I want my persistent state to be in a model object which is subclassed
from PRObject (or from PRStructure, if it is to contain child pier
components). Pier will then persist the model instances for me, within
the PRKernel root structure.

I specify the view class by overriding #viewComponentClass, and the view
class will then be instantiated by Pier, as needed.

Referring to the model from the view, I see that the PBHtmlView class is
using #find: to locate any instance of its model class within the tree.
That seems a bit, um, unpredictable for my purpose. Is it a good
practice to refer back to the model from the view by calling "self
context structure", or is there a better way of doing it?

Cheers,
Nick


More information about the smallwiki mailing list