--
You received this message because you are subscribed to the Google Groups "The Java Posse" group.
To post to this group, send email to java...@googlegroups.com.
To unsubscribe from this group, send email to javaposse+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
The Grails framework essentially gives you a
convention-over-configuration application framework (based on
Spring/Hibernate) excellent for creating corporate CRUD apps quickly.
R
> For sheer speed of development, I'm getting some great mileage out of
> twitter's bootstrap[1] on the client-side and James Strachan's
> scalate/jade[2] on the server.
+1 for Twitter Bootstrap, that I'm using for all my new websites, which
have dynamic parts. In this case I use a custom made CMS based on Spring
MVC. For more dynamic websites I'd try Wicket, which works very well with
HTML templates.
--
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
fabrizio...@tidalwave.it
http://tidalwave.it - http://fabriziogiudici.it
I've heard good things about Play with Scala, I think I'm gonna check that out next.
Alex
If you don't want that, then Grails is not for you.
As much as I see its value, I have to point out that there is a
learning curve to learning Groovy and the way Grails does things.
My app has a requirements where the war file is created ONCE and then
pushed through the environments and eventually ending up in prod (with
various test phases along the way).
This is not the preferred Grails way however and I spent many days
circumventing the build system to get it to do what I want (and I
still feel its a hack).
I really, really like Groovy. However, it will take time to get used
to and use it appropriately. I still forget the sort of magic you can
do (because its so non-obvious). Like with maps (reference key as if
attribute) and Expando and MockFor and StubFor, etc...
So I guess what I'm saying is do your due diligence for suitability,
then plan some time to learn it and make mistakes - don't push for it
on the first business critical project that comes along because you
think you can develop it quickly (because thats what you heard on a
forum somewhere).
Thanks
R
Feel like sharing how you did it? This is a best practice at many
organizations due to change controls.
Wayne
2012/2/10 Cédric Beust ♔ <ced...@beust.com>:
Horrible!
> here is an example of a wicket URL (for artifactory):
> http://artifactoryserver:8082/artifactory/webapp/?wicket:interface=:2::::
>
> Horrible!
It's possible to "mount" a pretty-looking URL in place of that stuff.
> Just spotted this on DZone. It might be relevant:
> http://css.dzone.com/articles/comparing-web-frameworks-and
Interesting. Lift would be even worse than JSF, and Play not much better.
I'm curious what makes Lift so bad. Having templates that are 100%
html is something that still looks highly enticing to me. The css
based replacement mechanism looks very strong. (I have only done a
few toy projects in lift, but to say there are more than a few
features from it I always wish I had would be an understatement.)
Or are you just referring to how stateful it is? I'm still not
convinced that is a poor choice. I was under the impression JSF was
bad because of the odd lifecycle of everything.
> "worse" on what dimension?
Don't ask me, of course, ask the presentation author :-) I see a diagram
where frameworks are ordered by a certain score, which if I understand
well is created by summing intermediate values. It's not clear to me who
gave those values.
You have to make some value judgements.
To me the values are off the top of my head (with no weighting or
order, and probably incomplete):
1) restful URLs
2) ease of development/productivity
3) performance
4) active community
5) ability for designers to "tweak" (easy CSS/HTML tweaks w/o having
to build/restart)
6) intuitiveness
7) ease of testing
8) weight (is it huge, does it take forever to start?)
9) extensibility
Rails wins on all this except performance, but it's ruby which is a
non-starter for most Java shops
From what I see Play is the best Java alternative. It has much of the
rails philosophy, ease but it's in Java.
I also say this without developing a major app in Play. I'd like to
hear other's thoughts on this who have used Play extensively.
--
My only critique is that I prefer scalate's jade templating language over play's own templates. But there's a module available for that, so it's really not a very big complaint :)
2012/2/17 Cédric Beust ♔ <ced...@beust.com>:
All good points Cedric. So which framework meets these criteria?
This is another important aspect for a web framework, in my opinion: being template technology neutral.
On Feb 17, 2012 6:44 PM, "Cédric Beust ♔" <ced...@beust.com> wrote:
>
> On Fri, Feb 17, 2012 at 9:35 AM, Kevin Wright <kev.lee...@gmail.com> wrote:
>>
>> My only critique is that I prefer scalate's jade templating language over play's own templates. But there's a module available for that, so it's really not a very big complaint :)
>
>
> This is another important aspect for a web framework, in my opinion: being template technology neutral.
>
> There are many, many ways to generate content with templates. First the back-end/front-end dichotomy. On the back-end, you have Freemarker, maybe Velocity (kinda abandoned I think?), Scalatra and then the web frameworks' own templating mechanisms.
Not quite, Scalatra is an entire framework in its own right, heavily inspired by ruby's Sinatra framework (see! It doesn't only have rails...)
Scalatra then uses the scalate scala-based template engine, which is the latest brainchild of James Strachan (creator of Groovy)
> On the front-end, you have another embarrassing of riches, such as Mustache or Handlebars. Going even further, you can reconfigure your CSS with on-the-fly technologies such as Less, or generate them statically and including them the normal way.
>
> And of course, the web framework must also be at least Javascript neutral and ideally, offer some kind of integration with mainstream Javascript technologies such as jQuery.
>
> --
> Cédric
>
>
This is certainly the REST ideal, but it's not so simple as it sounds. Even in a rich-client environment you can still expect back end servers to:
Handle json serialisation/parsing
Manage routing to restful endpoints
Perform caching and gzip compression
Co-ordinate chunked http streams
Convert coffeescript to Javascript
Convert less/sass to CSS
Minify/aggregate resources
Marshall data across domain boundaries
Authorisation/authentication/oauth/ssh termination
Etc.
even with a client-side framework like bootstrap, I still prefer to generate the html from jade templates, it allows for better Modularity.
"just" serving up data really isn't all that trivial...
--
> This is certainly the REST ideal, but it's not so simple as it sounds.
> Even
> in a rich-client environment you can still expect back end servers to:
>
> Handle json serialisation/parsing
> Manage routing to restful endpoints
> Perform caching and gzip compression
> Co-ordinate chunked http streams
> Convert coffeescript to Javascript
> Convert less/sass to CSS
> Minify/aggregate resources
> Marshall data across domain boundaries
> Authorisation/authentication/oauth/ssh termination
> Etc.
Agreed. My ideal requirement is that the web framework, starting from
Cédric's principles, has got a core that only serves data, as Moandji
said. All the other things should be provided by add ons (libraries,
plug-ins, etc...) that I only add when I need.
The main win for me using rest (get requests) as opposed to e.g. soap (post requests), is cacheability.
Fronting such a service with a varnish cache is about as easy as it gets. Even in the face of rapidly changing data, varnish works perfectly well with cache times down to 1/2 a second. This may not seem very useful at first, but it can make a significant difference when scaling up to thousands or millions of hits per hour.
If latency is even more critical than that, or if caching doesn't make sense because your clients all have distinct results, then I'm a big fan of json over chunked/streaming http - at least until Web sockets become a great deal more prevalent.
This is certainly the REST ideal, but it's not so simple as it sounds. Even in a rich-client environment you can still expect back end servers to:
Handle json serialisation/parsing
Manage routing to restful endpoints
Perform caching and gzip compression
Co-ordinate chunked http streams
Convert coffeescript to Javascript
Convert less/sass to CSS
Minify/aggregate resources
Marshall data across domain boundaries
Authorisation/authentication/oauth/ssh termination
even with a client-side framework like bootstrap, I still prefer to generate the html from jade templates, it allows for better Modularity.
I was just reading a 37 Signals blog post about how they do exactly this. Instead of passing JSON to the client, they pass server-rendered HTML. A previous bad experience with a project that did that made me wary of the approach, but now I'm rethinking my stance. With a good templating engine (ie. not JSP) and a disciplined approach, maybe it could work well.
> On Sun, Feb 19, 2012 at 5:30 AM, Moandji Ezana <mwa...@gmail.com> wrote:
>
>> I was just reading a 37 Signals blog
>> post<http://37signals.com/svn/posts/3112-how-basecamp-next-got-to-be-so-damn-fast-without-using-much-client-side-ui>about
>> how they do exactly this. Instead of passing JSON to the client, they
>> pass server-rendered HTML. A previous bad experience with a project that
>> did that made me wary of the approach, but now I'm rethinking my stance.
>> With a good templating engine <http://www.jamon.org> (ie. not JSP) and a
>> disciplined approach, maybe it could work well.
>>
>
> I think there are valid reasons to follow this approach, the most
> important
> to me being: what language is more convenient for you to render the
> template? There are a few cases where Java's module support can lead to
> more reusability/maintenance than Javascript when you start generating
> complex HTML+CSS stuff. This also applies when the UI composition is done
> on the back-end with something like GWT, obviously. Obviously, another
> advantage is a more unified stack (everything is done in Java/Scala as
> opposed to having to throw HTML/CSS/Javascript in the mix).
After so many years, a thing that I still don't like, but it's present in
FreeMarker, Play, etc..., is that templating uses a syntax other than
HTML. This is fine for pure programmers, not good when a graphic designer
must be involved - or when you want to use a HTML editor. I prefer an
approach where everything is HTML.
I was just reading a 37 Signals blog post<http://37signals.com/svn/posts/3112-how-basecamp-next-got-to-be-so-damn-fast-without-using-much-client-side-ui>about how they do exactly this. Instead of passing JSON to the client, theyWith a good templating engine <http://www.jamon.org> (ie. not JSP) and a
pass server-rendered HTML. A previous bad experience with a project that
did that made me wary of the approach, but now I'm rethinking my stance.
disciplined approach, maybe it could work well.
I think there are valid reasons to follow this approach, the most important
to me being: what language is more convenient for you to render the
template? There are a few cases where Java's module support can lead to
more reusability/maintenance than Javascript when you start generating
complex HTML+CSS stuff. This also applies when the UI composition is done
on the back-end with something like GWT, obviously. Obviously, another
advantage is a more unified stack (everything is done in Java/Scala as
opposed to having to throw HTML/CSS/Javascript in the mix).
After so many years, a thing that I still don't like, but it's present in FreeMarker, Play, etc..., is that templating uses a syntax other than HTML. This is fine for pure programmers, not good when a graphic designer must be involved - or when you want to use a HTML editor. I prefer an approach where everything is HTML.
On Fri, Feb 17, 2012 at 9:29 PM, Kevin Wright <kev.lee...@gmail.com> wrote:This is certainly the REST ideal, but it's not so simple as it sounds. Even in a rich-client environment you can still expect back end servers to:
Handle json serialisation/parsing
Manage routing to restful endpoints
Perform caching and gzip compression
Co-ordinate chunked http streams
Convert coffeescript to Javascript
Convert less/sass to CSS
Minify/aggregate resources
Marshall data across domain boundaries
Authorisation/authentication/oauth/ssh terminationI agree with Fabrizio: most of those things should be handled by other libraries. The web framework should just translate HTTP to Java, Scala, etc. and back. From there, a well-designed framework would make it easy to integrate wro4j, Jackson/Gson, my favourite templating engine, an ORM, etc. It would be great if such a web framework could be built around just @Inject or maybe CDI, so as to minimise its impact while easing integration.
> With XML/XHTML it gets worse. We not only ramp up the number of elements
> demanded by ever-richer content, but also have the rule that each element
> must be 'closed' so that we can maintain structural validity even whilst
> manipulating those elements. It's an explosion of boilerplate in a
> format
> taken far outside of its original use-case.
I don't understand why so many people (not only Kevin) see XML as a
problem, while I see XHTML an improvement over HTML, and don't see tons of
boilerplate. But I understand the remainder of the points.
>
> Sad but true... HTML is still a necessity for no other reason than tool
> support. Even then, attempts to use HTML as a templating language have
> often been less than successful; I'm sure we all remember how many
> earlier
> tools would just choke and die when encountering JSP's <% %> and other
> such
> non-standard tags from alternate frameworks.
Exactly. But what I meant was precisely templating by HTML tags, not
"quasi-HTML" tags. For instance, Wicket basically uses plain HTML.
For this I'm quite liking the look of Spark:
http://www.sparkjava.com/readme.html
It's extremely minimal and works well with Guice etc.
If you consider an enterprise application that will have a few hundred forms in a 3 years period, do you think that it will be manageable if client side is completely implemented in html/js?
--
You received this message because you are subscribed to the Google Groups "Java Posse" group.
To view this discussion on the web visit https://groups.google.com/d/msg/javaposse/-/XLf0AHrd-7YJ.
I've built web apps with REST (Jersey) web services + client side HTML/JS with jQuery and ExtJS but without a server-side HTML templating piece. I love this approach, but sometimes a server-side HTML templating framework is neeeded, in which case Play seems like the most elegant choice today.
Client side templates? Is this where HTML is generated by client-side JavaScript from web services data?
If you consider an enterprise application that will have a few hundred forms in a 3 years period, do you think that it will be manageable if client side is completely implemented in html/js?