aspose file tools*
The moose likes Spring and the fly likes Spring roo question for Ashish Sarin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring roo question for Ashish Sarin " Watch "Spring roo question for Ashish Sarin " New topic
Author

Spring roo question for Ashish Sarin

Edwin Nels Johnson
Greenhorn

Joined: Mar 13, 2011
Posts: 3
Hi Ashish,

Since Spring Roo generates code for you - are there any mechanisms to protect any customization that you do to that code? If another Spring Roo command is issued to alter an entity class for example, will this wipe out any customization?

Ashish Sarin
author
Ranch Hand

Joined: Nov 20, 2000
Posts: 432
    
    5
Spring Roo is a smart tool, it's architecture supports code customization that can be retained.

Let's say you create a web controller using Spring Roo. The code generated by Spring Roo is split into two parts:

1. AspectJ ITD files (these are similar to Java source files but have a slight different syntax). The code in AspectJ ITDs is managed by Spring Roo. So, you must not modify methods, constructors and attributes defined in this file. This file has .aj extension.

2. Java source file. Roo will never overwrite any modifications that you make in methods, constructors and attributes of your Java source file.

Let's say you want to customize a method definied in AspectJ ITD file. You can use Push-in refactoring to move the method definition from AspectJ ITD file to the corresponding Java source file. Now, you can modify the method in the Java source file. This will ensure that your modifications are retained.

regards
ashish


Author of
Getting started with Spring Framework
Portlets in Action
Spring Roo 1.1 Cookbook
Portlets blogSpring Roo blog
Edwin Nels Johnson
Greenhorn

Joined: Mar 13, 2011
Posts: 3
Thanks Ashish - I'm looking forward to learning more about Spring Roo and trying it out.


 
Don't get me started about those stupid light bulbs.
 
subject: Spring roo question for Ashish Sarin