[stringtemplate-interest] Fwd: [antlr-interest] StringTemplate functions like capitalize()?

Joan Pujol joanpujol at gmail.com
Sat Apr 14 02:35:05 PDT 2007


Hello,

I completely agree with you. Strict enforcing of view/model separation is
good... But so much strict enforcing can be bad If it obligate you to modify
the model to made the view happy.

Cheers,

On 3/21/07, Nate <misc at n4te.com> wrote:
>
> Calling an arbitrary method from ST is against the rules, but the action
> the OP is trying to perform is for display only. The only real solution
> is to get the ST source and add a capitalizeFirst function. Other
> solutions are clunky at the very least.
>
> On a similar note, I have found the lack of ST expressiveness a problem.
> I have lists of objects that contain the data I want to display. In many
> cases the objects contain lists of other objects. When the data in my
> objects are not in such a format that ST can display them like I want, I
> find I have to modify my objects to expose the data in the way ST needs.
> What this means is that the UI layer is affecting my API. For simple
> templates, values can be retreived from an object and put in various
> template attributes. But more complex object graphs make this very messy
> and difficult, if not impossible.
>
> I am all for separating model and view, but I don't think view-only
> logic expressiveness should be lost. As it is now with ST being
> relatively strict with enforcing the "rules", there are still various
> ways I can break the separation. 100% fool proof would make ST too
> restrictive and difficult to use. You have made certain sacrifices and
> this makes sense. I think ST should follow all the rules out of the box
> and enforce them to the best of its ability, but make it easier to
> implement view-only logic. It should be easy to add a view method like
> capitalizeFirst.
>
> -Nate



-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
http://lujop.deviantart.com


-- 
Joan Jesús Pujol Espinar
http://www.joanpujol.cat
http://lujop.deviantart.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org:8080/pipermail/stringtemplate-interest/attachments/20070414/80c6d02f/attachment.html 


More information about the stringtemplate-interest mailing list