Adding Roo to a project using pull-out refactoring
The pull-out refactoring is the reverse of push-in refactoring. In push-out refactoring you extract methods and attributes from the Java source file and move it to an AspectJ ITD file. This feature is particularly useful in the following situations:
If you had earlier performed push-in refactoring on your Roo project, and now you want to develop your project once again using Spring Roo
If you have partially developed a project and now you want to use Spring Roo in its development
In this recipe we'll look at how to pull-out the
toString
method from theFlight.java
file toFlight_To_String.aj
file.
Getting ready
Follow the instructions specified in the Removing Roo with push-in refactoring recipe to push the toString
method defined in the Flight_To_String.aj
file to Flight.java
file.
How to do it...
Follow these steps to move the code from Java source file to an AspectJ ITD file:
Create a
Flight_To_String.aj
file in thesample.roo.flightapp.domain...