Introduction
Have you thought of a new service or application, probably your "next big thing" or THE NEXT BIG THING? If so, then we are on the same boat. The next problem is how will you build it? It also depends on your programming language, but I will be focusing on Java.
It is in my best opinion that you are better-off using a framework in achieving your goal. Sure you can use the standard Servlet and JDK but if you plan on creating a web application it is beneficial to have a set of tools that are already available and free so that you won't have to create everything from scratch and focus on what is more important, your "next big thing".
Java developers are open to a huge variety of web frameworks but as a human, you arguably cannot master all of them. There are two reasons why I believe this is a great time for Java developers to get to know new standard frameworks:
1) Maturity. As of writing, many of the new frameworks seem to have matured; they are ready for enterprise.
2) Java is inching its way to mainstream. Performance is becoming trivial because of new innovations like cloud computing, but this discussion is for another time.
Different Java Web Application Frameworks
Before I chose Grails, I read a lot of articles and reviews about the new frameworks that are readily available. I am not adept with many of the new frameworks listed here although I have tried working with Struts, Hibernate, Java EE, Spring, and now Grails. What I will write is my own biased opinion and a quick summary of what I have read:
Tapestry. Wicket, Stripes
I've put them together because I can't say much about them and I’ve eliminated them from list immediately. Tapestry has a steep learning curve and release periods are long. Wicket, too much Java, even html is in Java. Stripes is unknown for me.
Because of my experience, I am more inclined to use one of frameworks below. Also, these frameworks would more likely get you a job (see references).
Standard Java EE
Java EE is the sun standard for building Enterprise web applications. Well, their standard is not that intuitive for me and it still takes a lot of work to build an application. This is better suited for firms with lots of workers as they can assign teams per component and integrate them later. But for an individual like me, it's a No. Java EE standard also makes use of JSF, a tag library framework which takes care of the Java EE's presentation layer for better re-usability and a more "sound" programming. My opinion? Yes, the tag library is useful for the basic web controls but customizing it will take you a considerable amount of time.
Seam
Seam is not really a web framework, it's more of a layer for abstracting the new frameworks out there. The way I see it, they get the best of the components from several frameworks and put them together seamlessly (thus the name, duh!). I considered using this because it looks promising. But again, it's still too complicated and not intuitive for me (personal preference).
Struts 2
Although Struts (1), authored by Craig McClanahan, helped in building a big portion of enterprise applications to date, it is already considered obsolete by many, including me. I think it happened a few years after the release of Java 5 where developers took advantage the significant improvements in Java in addition to the vast knowledge learned in struts to create new and better frameworks.
Struts 2, which emerged from Struts 1, offers a simple architecture and customizable tag library. It is supposedly the successor of the very successful Struts but as far as I know the architecture is very different.
Spring MVC
Many are now developing enterprise web applications in favor of using Spring MVC, which is arguably better than Struts (See References). There are countless debates arguing which is better. It just goes to show that both are very good frameworks so it will narrow down to your preference as a developer.
Both Struts and Spring MVC are based on a Model-View-Controller (MVC), a model proven successful in developing enterprise applications. Most frameworks today follow the MVC model.
Grails
Built on top of Spring MVC, Grails is a web framework that harnesses the power of Groovy, a scripting language built on top of Java. It aims to make programming in Java dynamic and less cluttered, leading to productivity boost.
My pros and cons in using this framework.
Pros:
1) It follows a "Convention over Configuration" paradigm (see References) which I prefer. Logical data model (db structure) is created for you, views are created for you, controllers are created for you… What more could you ask for?
2) Developing applications are amazingly fast. With just a few codes, you can already have an up and running application with Create, Read, Update and Delete (CRUD) functionality.
3) Very good documentation.
4) Something new to learn at the same time: Groovy.
Cons:
1) Learning Curve is a little steep (I think this is normal in learning any new framework, but still listing it under Con). This framework is all about convention anyway, so you have to learn their convention but they are intuitive in my opinion.
2) It is still relatively new so the maturity is questionable but I believe it's already enterprise-ready.
In 2008, Grails was acquired by SpringSource, the creator of Spring. However, I'm confused with Spring Roo. I think it's competing with Grails, at least with SpringSources' resources. I hope they’d add more effort into developing Grails and making it faster and more flexible (e.g. Integration with Google App Engine). As a side note, SpringSource was then acquired by VmForce in 2009, seems everybody is buying somebody nowadays.
Conclusion
This exercise of choosing the right framework has taught me several things.
1) I prefer Convention over Configuration. As the statement implies, it reduces the number of configuration and repetitive tasks (especially those hellish xmls). (see References)
2) Framework is your friend. Frameworks for rapid Java application development already exists, it's just a matter of choice.
3) And when you have critically selected the best possible choices and you’re still left with a handful, it all boils down to your preference. Choose whichever you’re happy with.
To conclude, I have chosen to invest a considerable amount of time in learning grails because it agrees to what I believe in and I would like to believe that this framework has a very good future.
In the next topic, I'll be posting a prequel to starting my first Grails Application.
References: