The Platform Solutions Manager at a large digital agency in the world recently asked me:
If one was planning to develop a major Internet property using Java and needed to select a combination of frameworks with the following priorities in the following order:
1) Lightweight and responsive – most important
2) Rich internet application development (RIA):
a. RESTful URL structure
b. Built-in Client side validation or some JavaScript to make the application more robust
c. Built-in AJAX support
3) High developer productivity - rapid application development (RAD):
a. Convention over configuration
b. Scaffolding
c. Inversion of Control/Dependency Injection
What would you recommend? I’m looking at the Tapestry/Spring/Hibernate combination. And he referenced this article.
I get asked questions like this fairly often. My favorite looks like this:
1) Lighweight and responsive - Jetty
2) RIA development: Build all of the client logic in JavaScript using JQuery, ExtJS and packaged for deployment with Appcelerator Titanium. Make JSON calls over HTTP Post requests to the backend.
3) RAD development: For the server-side use NetBeans, annotations, and your own custom object library.
PushToTest is building a new Web front-end to TestMaker. Spring is still a fine choice to build the basic objects. However, using Java annotations is powerful enough and there are many choices there. I don't like Hibernate because object-relational mapping eventually becomes a scalable bottleneck - especially if you need to persist XML data in the database.
I choose to stay away from scaffolding systems with the expectation that the time it takes to eventually remove the scaffold is greater than the time saved in using the scaffold. I like plain old objects for easy maintenance over time.
I'm only one voice, so I forwarded this to my friends and partners. Here are the replies:
1) Ron Warshawsky
I would strongly suggest to consider extJS or GWT. I have lots of experience with them and like them a lot.
2) William Martinez Pomares
We had two worlds, one the plug and play, compose yourself, little specific frameworks, and the BIG, bloated Java EE Spec.
The framework combinations still has the same problem that the article mentions: You have to glue up all together. And you have version hell and jar hell all over the place. Still, they were light and popular.
Java EE evolved too. The new version 6 has a Web Profile that eliminates 80% of the fat. The reference server, Glassfish, is just 30-80 megs and contains all that you need, mostly reference implementations of all standards. Let's got through the list:
1. GlassFish is running on top of OSGi, with lazy initialization, so it is up and running in 10-30 seconds. Deployment can be done incrementally, thus modifying one part of the application can be automatically redeployed and the changes can be seen in less that 1 second, with no session loss.
2. The standard supports Java Server Faces, which is a MVC just like Struts or Spring, but has many nice features. For page composition it can use JSP or Facelets which is becoming very popular. Is support Ajax frameworks like PrimeFaces. Any EJB you create now can be exposed as RESTFull services with a couple of clicks and some annotations.
3. Now you can create one EJB with just writing @Stateless, all the rest is by default (convention over configuration). Most of the XML is now optional as you can write all in annotations. With NetBeans, you can import all entities from a database, create managing EJBs and create JSF pages for CRUD using just wizards (scaffolding). CDI is all over the place, local and remote with ejbs, just write @EJB and the name of the ejb to inject.
So, yes, you can go Spring and Hibernate. I would go JSF and JPA, standards and easier to use. Not sure about Tapestry, never used it, but before selecting one option I would give it a try, select the most critical issues you need to resolve and try to use one or the other tool and see which fits better for you.
3) Ole Lensmar
To be honest, I really haven't worked with any of these so my "recommendation" is based entirely on what I've read and seen on the web - my spontaneous suggestion would actually have been wicket / spring, but according to the article that isn't the best of choice :-) I have seen a lot of negative comments on Tapestry, so I personally wouldn't consider that based on this article only. Worth noting might be that the article is almost one year old, a long time in java-framework-world.
How about grails? or the play framework? http://www.playframework.org/
cheers!
4) Andy Oliver
There is something else he should consider, market forces. There is always another way of doing something but some things win and some things lose. In general Spring won. If you want something very AJAXy then GWT is the most popular among Java developers. If you are hiring more web-designer-y type people then JQuery + something on the backend (like Spring).
I disagree with the author's popularity methodology in the report. I can tell you that the facts on the ground are pretty different. JSF may result in more searches, etc. because it is more complicated and people searching for springmvc may be searching for more specific topics.
-Andy
PS I sponsored Tapestry into the ASF. While I continue to like the idea, it has never achieved the popularity of other frameworks.
What do you think?
-Frank