Monday, April 4, 2011

My First Impression of Spring Roo

In my previous post, I demonstrated how to set up a Web site with Spring Roo in 10 minutes. Actually I spent several hours to get it work, and even more to write it down and posted in my blog. For a beginner, it may take longer to understand the whole architecture and start to do real work. However, the beauty of Roo is you always have a running application to play with, and you can focus on learning one technology at a time, without being distracted by other things you are not familiar.

Here are what I like the Spring Roo:

First it fulfills my dream development environment. In my dream, I want to work with the best open source tools and best Java framework (in my opinion), such as Maven, Eclipse, Spring Framework. And I want to try the cutting edge technologies like GWT, OSGi. But I always get burnt by this ambition, it is impossible for me to learn all those and get my application work at once. Thanks to Roo Add-On Developers, I can use many new tools in an integrated running application before I even understand them.

Second, I like the round-trip rapid development process. You can use Roo to change your model, and Roo will update your Java code automatically. At the same time, you can also change your Java code, and Roo will automatically fix the generated aspect code and configurations. I also tried other tools before for generating project structure, such as AppFuse, Maven Archetype. They are good tool to start a project from scratch, but you cannot do it again with more changes. Now I can continuously use Roo to grow my application, and it really saves my time.

Third, I like the script approach. Roo will keep a log file at the project folder (log.roo) with all your commands. After several round of exercises, you can just copy the script from log.roo and modify it to have a clean model, then ask Roo to run it again from scratch. I find it is very useful when I design the domain model. Other RAD tools may use UML to do the same, but I feel UML Diagram is better for communicating among people. When get down to code level, text based script is superior for talking to computer.

Last, I love the code it generates, beautiful code. Roo uses AspectJ inter type declaration (ITD) feature to hide all those boilerplate code, so the generated Java code will be very clean. After you understand how it works, you won't want to go back to the old way.

After first try of Spring Roo, I think it will be useful in two areas:

  • Rapid Prototyping. Right now as an application designer, after discussing with business, it will take me many days to build the domain model and mock up UI. When the first approach is not right (always happen), I have to throw away old code and write those boilerplate code again and again. Roo can help me build a prototype quicker, especially for domain model part.
  • Standard Application Architecture. I didn't try Add-On development, but I assume it is doable to customize Roo so it will generate code following standard in any enterprise. Therefore in any corporation, it will be very fast to start a new project, and let developer focus the business issues instead of infrastructure issues.

Here is my wish list for Spring Roo:

  • Provide richer script command to build complete domain model. It has excellent support for Entity, little support for Value Object or Domain Service. I want Roo to generate methods for me as well.
  • Support Maven structure for multiple projects. Currently seems Roo only supports one project structure. For a medium to large application, we may have to split code into several projects. Hope Roo will support it in the future.
  • Better support to Google App Engine and GWT. I will try it when 1.1.3 is released.
  • See what Roo can do after it integrates with WaveMaker. If UI design is as quick and clean as this, I can talk to customer and build running demo on the fly. That's my biggest dream.

Overall, my first impression of Spring Roo is very good. I appreciate SpringSource for providing this wonderful tool for Java developers. They are the true leader in Java Open Source Community.

1 comment:

jiwhiz said...

Kai Wähner also posted his experience with Spring Roo When to use Spring Roo?