[prev in list] [next in list] [prev in thread] [next in thread] 

List:       stringtemplate-interest
Subject:    Re: [stringtemplate-interest] Separation issue
From:       Brian Clapper <bmc () clapper ! org>
Date:       2010-05-24 16:10:30
Message-ID: 4BFAA4F6.8040602 () clapper ! org
[Download RAW message or body]

On 5/24/10 12:01 PM, Jonathan Buhacoff wrote:
> You don't want the size range in the model because it's something the
> designer might want to tweak right?
> 
> You can add a size scale to the model that the view can use. Two easy
> options:
> 
> 1. Add a fourth attribute like scale = floor(totalArticles / 5).  Then
> use css attributes like size$scale$ so size1, size2, etc instead of big
> and huge.  Use a formula with log and a scale factor to get results that
> will accomodate growth.
> 
> 2. Use a number renderer to implement this same formula but with an
> explicit scale factor:  size$scale; format="..."$ so you still get the
> same css labels and you can adjust the scale from the view when needed.

These are reasonable suggestions, though they still put view-specific logic
outside the view, in my opinion. The arbitrary partitioning of discrete numeric
values into CSS thresholds, for the purposes of styling, strikes me as
view-specific. Ideally, I'd like to isolate the logic completely within the
template.

Using (abusing) the "format" capability is another option.
-- 
-Brian

Brian Clapper, http://www.clapper.org/bmc/
He'll sit here and he'll say, "Do this!  Do that!"  And nothing will happen.
	-- Harry S. Truman, on presidential power
_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest@antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic