jon
MEVL went from really exciting to really disappointing *fast*.
There's no way to enable null-safe gets as the default for property
navigation, so you end up having to type this all the time:
foo.?bar.?baz
This alone is annoying but not fatal. The fatal flaw is when you need
a null test for the root node:
?foo.?bar.?baz
This prouces an error because MVEL misinterprets the first ? as a
ternary operator. The guy maintaining MVEL flagged this case as Not a
Bug in jira. Fuck that. Why is it that all codehaus projects seem to
be disasters (arguably jackson being the sole exception)? Even the
infrastructure doesn't work - their mailing list system is horrid and
full of broken links.
Conclusion: Almost entirely because of lame null handling, MVEL is
not suitable as a web template expression language.
Jeff
Conclusion: Almost entirely because of lame null handling, MVEL is
not suitable as a web template expression language.
I'm not overly concerned about performance as long as it's reasonable
(ie, not XSLT). Really I think we'd like something that is a cross
between JSP-EL and Velocity. Honestly I really like the Cambridge EL
except that it doesn't let us pass parameters to functions, which is
rather critical. Our problem areas have been:
NULL CHECKS
${foo.bar.baz} should produce null if any part of the chain is null.
This is super common in web templating, for example we have stuff like
this:
class Location {
String name;
GeoPt geo;
}
class Person {
Location location;
}
For some users, the location field is null... I don't want to have
special syntax for this nullability check.
METHOD CALLS
This just makes life easier. For example, we have a Person object on
the page and a Club object in the page. The Club object may have a
method canEdit(Person pers) to check if the person can edit the club
and the template should be able to use this to determine whether or
not to render an Edit button.
I'm sure there are other issues we'll bump into but those are the main
ones. In the past I've suffered with JSP-EL and Velocity, but my last
copule projects were GWT-based so templating was never an issue. Now
that I'm back in java template land, I'm disappointed that not much
has changed. Cambridge seems to be the only one that "gets it" but
I'm baffled why the Java community hasn't jumped on it en mass. My
sneaking suspicion is that the Java community is a hollow shell of
what it once was. It's dying :-(
> My primary criteria are:
> * designer friendly, eg, not broken markup (yay Cambridge), no or minimal
> code exposure - so simple logic (expression,if/for))
> * high performance - templates can be compiled to bytecode (nice to have).
> Eg, not Groovy.
> In the past, I built optimization algorithms where we wanted to allow custom
> rules to be evaluated in the inner loop of the algorithm. We looked at JEXL
> along with others (including Javascript) and ended up using Janino - for
> performance. Janino was an efficient but ugly solution.
Interesting, didn't see that one.
> (btw Edinc, Jeff is an awesome tool builder (but reluctant - because he's
> building great software not tools! :) ) - he's part of several awesome
> projects that have improved my life. I don't know as much about Jon, but he
> mentioned being part of the Velocity team. These guys rock.)
Awww, thanks... Jon and I have worked together for years, both
professionally and on opensource projects. He was one of the founders
of the Jakarata apache project waaaay back when. Top-notch developer
and I'm glad to finally be working with him as a business partner
rather than just a coworker :-)
Jeff
I'm baffled why the Java community hasn't jumped on it en mass. My
sneaking suspicion is that the Java community is a hollow shell of
what it once was. It's dying :-(
Moving to github would be a big plus just because it would be easier
to manage contributions with pull requests. Dunno if it would
contribute to visibility though.
Complete documentation would probably help a lot. The existing
documentation is good, there are just major pieces obviously missing.
From that it looks like an incomplete project. I fully believe that
documentation is the #1 most important feature of any library because
it's the first thing a developer looks at. It's likely that a lot of
people pass on Cambridge just because the DevelopersGuide is
incomplete. Even without putting additional work into it, just
removing the empty header sections would improve the appearance of
completeness.
While I'd like to think the Java community is vibrant, from my vantage
point (the bay area startup scene) it looks bleak. All the "cool
kids" have moved on to Ruby or Scala or Python, and it's rare to see a
Java-based startup. Development of opensource java tools has slowed
waaay down. Major projects (especially parts of the JEE stack) have
been abandoned (eg OpenSymphony). There are still great reasons to
write Java (obviously I'm doing it) but the opensource community is
not what it once was.
My client development has all been GWT-based for the last two years
and this new app is going back to a page-centric model. I looked
around at templating options expecting great improvements in the
tools, but it looks like everything is stagnant. JSTL hasn't changed.
JSF? Garbage to begin with, garbage still. Velocity, Freemarker?
Same as they ever were, but the communities seem to be shrinking.
Cambridge is the first template system I really like, but I'm just not
sure anyone is writing webapps in Java anymore.
FWIW, I'll do what I can to evangelize because Cambridge is really
great and deserves a wider audience than it has right now. I'm
especially pleased that the code is pretty well organized and easy to
understand. It's a major shift from the horror I feel every time I
have to wade into Resteasy's awful morass.
Jeff
It's a major shift from the horror I feel every time I
have to wade into Resteasy's awful morass.