Renderer demo: Code review, please?

Anastasia Cheetham a.cheetham at
Fri Sep 25 18:30:38 UTC 2009

As discussed, I've been working on a Renderer demo for the portal.  
I've got something that basically works (though it's hideously ugly at  
this point - I'll throw in some FSS to make it beautiful). It's in the  
demos section:

Given that the purpose of the demo is to illustrate some of the 'best  
practices' for working with the demo, I'd appreciate it if someone  
could look over the code and check whether or not I'm actually using  
any of the 'best practices' :-)

As Colin mention, I've tried to show
* Using cutpoints, not IDs in the markup
* Programmatic tree generation using fluid.transform
* A blend of data-bound and literal values

and to use
* UIBound for plain text
* UIContainer for repetitions
* UISelect for a drop down, checkboxes, or radio buttons

I also used fluid.explodeSelectionToInputs for a couple of chunks of  
the tree, and I thought I'd put in a few more 'plain text' things. I  
also plan to add lots comments explaining what things are doing (I  
just thought I'd make sure I'm doing things right before I explain  

Regarding cutpoints: what is the 'right' way to use cutpoints? I'm  
essentially hard-coding them, but that doesn't seem like a 'best  

I'd also appreciate comments on my use of the ChangeApplier to trigger  
the display of the changed model - will that complicate things?

Finally: Does anyone know an easy way to pretty-print a JSON object?  
I'm looking around, but not finding any help.

Anastasia Cheetham                       a.cheetham at
Interface Developer, Fluid Project
Adaptive Technology Resource Centre   /   University of Toronto

More information about the fluid-work mailing list