[stringtemplate-interest] Conditional statements

Kay Roepke kroepke at dolphin-services.de
Sat May 6 13:55:45 PDT 2006


On 6. May 2006, at 22:46 Uhr, Kay Roepke wrote:

> But (2) really puts a lot of the controller into the template,  
> which may or
> may not be a Good Thing. That really depends on the assumptions you  
> can make about the environment
> you work in.

Sorry to follow up on myself, but I remembered one thing I wanted to  
add.

The separation of controller and view is a delicate thing. In one  
case it looks like the controller is getting
too much of the view responsibilities and in the other it seems the  
other way round.
I guess it really depends on which application you have in mind.
Generating HTML files or source code (like ANTLR v3 uses ST) it  
probably is ok for the controller (code generator)
to know a lot about the formatting stuff, what goes in which place  
(thinking of string encoding and numbers (hex/long/float etc.).
In a GUI system, on the other hand, it is not uncommon for the view  
to actually request data from the controller (and thus pulling)
and attaching formatters to text fields and such things.

So it all comes down to: Do I have a more passive view, or is it a  
dominant, bitchy one, that's yelling give me this, give me that,
all the time? And it even wants to decided how a date looks like  
these days...

-k


More information about the stringtemplate-interest mailing list