开发者

What are the prerequisite for Spring Roo

开发者 https://www.devze.com 2023-02-17 15:50 出处:网络
I have got my hands dirty in Spring Roo, I have managed to do the persistence set up for Oracle Database. Although I have gone through the Roo documentation

I have got my hands dirty in Spring Roo, I have managed to do the persistence set up for Oracle Database. Although I have gone through the Roo documentation but it not enough for me to understand the working of this framework.

I'm not aware of Spring-MVC ,Spring-Web Flow and AspectJ rather I have knowledge of frameworks such Struts, Tapestry and GWT. Could this be a hindrances in learning Spring Roo.

Please advice as I'm running out of patience of hacking the gen开发者_开发问答erated code by Spring Roo.

Is it good idea for me to jump in a Spring Roo project?


The Spring Roo is more than a code generator. If you make changes in your Entities, it will change the codes automatically. More like a stateful code generator. First you need to find out the commands available in Spring Roo to configure a project.

You can configure which database you want to use, which orm you want to use, whether you want to use unit-tests or which view technology you want to use. Give the commands and Roo takes care of it. You don't need to worry about which libraries to download, how to make pom file for Maven.

The configurations you got using Spring Roo is quite a standard one. I used it in the previous projects. The code generated is not optimal, for example , you can use generic daos instead of Roo generated DAO if you consider the generated codes are verbose.

Another example says, in Flex, you can use Roo to generate configurations for the communication between Flex client and J2EE server. For my case, I use parsley and observer patterns for flex client instead of the codes generated by Spring Roo. But by looking at the codes what the Roo-Flex team wrote taught me quite a lot of things too. The same things goes for GWT and Spring MVC.

So what am I saying is that as the programmers, we need not only to code we also need to read what the other wrote too . I strongly believe that it is a good way to learn and share best practices. You might get some boilerpate codes, but if you know how to apply design patterns or can enhance on them, those codes will become the gems.

Learning curve ? Not at all. The commands are as simple as DOS commands.


Spring ROO is just a command line interface for generating a lot of the boiler plate code you usually need to write to get things done in java projects.

If you want to add GWT into your project, just type "gwt setup" after you've created your models and you have full-on GWT support in your project.

The default view being generated in Roo uses Apache tiles, similar to Struts, Tapestry and JSF.

If you want to use web flow, just type in "web flow" and it'll be integrated for you, for struts support, you'll need a plugin, I've seen a couple of them floating around the web, haven't tested any of them; same goes for tapestry, you can either use a tapestry plugin or do the integration by hand.

AspectJ in the context of Roo generated scaffold is used to hide all the boilerplate code that makes code look like spaghetti, you can move code out of the aspectJ generated files into your own java files and modify them if you need to.

As for the hacking, it takes a lot of patience and time to fully understand where you should change stuff and where you shouldn't, all I can say is, happy hacking :-)


springroo is based on many technologies, but all what springroo does is to help you to generate scaffolding code using lots of addons you can install

at least it's my view of this framework after three days of learning it

0

精彩评论

暂无评论...
验证码 换一张
取 消