• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring roo question for Ashish Sarin

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Edwin Nels Johnson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ashish - I'm looking forward to learning more about Spring Roo and trying it out.


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic