[stringtemplate-interest] null vs missing vs emptyvsnonexistent
Graham Wideman
gwlist at grahamwideman.com
Tue Oct 20 20:32:23 PDT 2009
> Zenaan said:
>MVC recursion says that to the extent this 'data cleaning' is a view
>specific thing unrelated to the system's data-model, that a view-model
>is created for just this purpose (distinct from the data-model (which
>business logic uses/ requires) and from view-view (ie ST)).
Agreed. I think some confusion arises in simplifying the concept of ST to "handles model-view separation" -- this suggests that ST aspires to be *solely* responsible for producing the view, with no impact in the calling application (other than filling in attributes).
One *could* imagine an apparatus that does this, a sort of Java Objects Query Language, for example, but really, we more or less have that already and it's called "write some view code in Java in a separate class".
At any rate, it's not what ST is intended for, at least as I understand it.
I think it's perhaps helpful to note that though the calling app can pass various data types to ST attributes, at the point where they "cross over into ST land" they've been converted by the caller to strings. (ie: in Java they have to have a toString method, and the result of that is what ST works on.) Hence *String* Template. But with a slight bending in the "if" area, to facilitate the caller sending enable/disable signals to ST.
So again, no intent to become a general computing language.
That said, there seems room to debate the features that are always or often view issues, such as handling of whitespace, wrapping, padding, missing/null values, output variation based on counts of items and so on.
-- Graham
More information about the stringtemplate-interest
mailing list