raul.arabaolaza
Sep 30th, 2009, 05:33 AM
Hi,
For what I read in the forums it seems that many people are afraid of using Roo due to vendor lock in. The use of AspectJ and ITDs and the Roo* annotations are the most controversial points. More and more people asks about how to push in and getting free of the ITDs and annotations.
First time I use Roo I was afraid too, I work in a very rigid enviroment I canīt deploy any piece of software with any library not previously aproved by the IT team (ok, iīm part of the IT team, but triying to convince IT people about technollogys is like triying to make a father say his daugther is not the most beatifull girl in the world (mine is ;) ).
But most of this concerns are not concerns at all, Ben and Stefan have been very busy explaining how easy is to get rid of Roo in your project, and Benīs posts about Roo (http://blog.springsource.com/2009/06/18/roo-part-3/) explain very well Rooīs motivations and internals, but maybe there are in a dificult place to find for new Rooīs users, I will try to explain why the vendor lock in is not really a problem when using Roo.
DISCLAIMER:All that I say here is only my opinion and you are free to disagree, also Iīm not part of SpringSource or Rooīs team, so I may be wrong. Ben, Stefan, please feel free to edit/remove this post any way you want.
Now that all legal issues have been adressed letīs begin with the lock in issue...
Use of ITDs makes my application AspectJ dependant
Ok, ok, so most of Rooīs generated code is on ITDs, ITDs need AspectJ... So my application will need AspectJ?.
Thatīs false, AspectJ need ends when you compile your application, you can think on Rooīs ITDs like java code in a separate file, Aspects are used only to introduce that java code into your application, but your application WILL NOT use any aspect (unless you want it) so your application WILL NOT need aspectJ in any diferent way a usual Spring application will need it for using Spring Roo.
Think in the ITDs as a tool, the same as Eclipse, you can develop with Eclipse and generate code with it, but the generated application will be completely eclipse-free, the same thing happends when you use ITDs to generate code.
Rooīs projects handle ITDs transparently, so users donīt need to know anything about weaving, the generated mavenīs pom for the project uses AspectJ compiler to weave ITD, you can be ignorant of all aspectj related stuff and use Roo at full power, the same way you can ignore how eclipse makes all that funny refactors it have but use it all the day. You need AspectJ in your compile time classpath, thatīs true, but you will not need it once you have compiled your application.
The only real problem with ITDs are that some IDEs donīt have a decent AspectJ support, and itīs possible that things like code completion could not work. In a world full of Free IDEs I donīt see it like a very big problem, moreover Rooīs projects are Maven (ant planned too) based, so you should be able to use it on any IDE. Personally I use STS, Netbeans, and Eclipse depending on the project without many problems, I donīt believe in the "One IDE to Rule them All" mantra.
Use of annotations
Ok, ok, so I donīt need AspectJ, but my classes have things like @RooToString, moreover I have some nasty org.springframework.roo... imports in my classes, and a roo annotations jar file on my classpath. What about this, eh??
Annotations could create dependencies, thatīs true, JPA for example makes your entities JPA dependant, but unlike JPA, Rooīs annotations have a SOURCE retention policy so there are not in the generated .class file.
That means, I can use any Roo annotation I want, but my compiled classes WILL NOT have any Roo annotation so I donīt need any roo annotaions jar in my appīs classpath. So my app donīt depends on Roo.
Conclusion
When I use Roo to generate any kind of application I will have a generated application WITHOUT ANY ROO DEPENDENCY, I will have dependencies at compile time, that is I will need Roo to generate the distributable format of a Rooīs application, but this is not a dependency or a lock in risk, itīs simple what happends when you use a tool, if I want to use a hammer I will need a hammer, so if I use Roo to generate an application I will need Roo at build time only.
I know many people are not comfortable with AspectJ, donīt be afraid of it, Rooīs ITD are simply java code in a separate file, that code will be in your java file and you will not need to configure anything to make it happend
The need to get Rid of Roo appears only when you need to change your toolset for example if you want to bootstrap a project and after that use something like EMACS, in that case you could have a problem with Rooīs ITDs and annotations, and in that situations is where it makes sense to use Push in refactor and say "goodbye Roo". But thatīs true for mostly everything in java: i.e maven, eclipse, ant, jpa... with the diference that other technollogys donīt usually give you something like push in refactor :)
HTH, Raúl
For what I read in the forums it seems that many people are afraid of using Roo due to vendor lock in. The use of AspectJ and ITDs and the Roo* annotations are the most controversial points. More and more people asks about how to push in and getting free of the ITDs and annotations.
First time I use Roo I was afraid too, I work in a very rigid enviroment I canīt deploy any piece of software with any library not previously aproved by the IT team (ok, iīm part of the IT team, but triying to convince IT people about technollogys is like triying to make a father say his daugther is not the most beatifull girl in the world (mine is ;) ).
But most of this concerns are not concerns at all, Ben and Stefan have been very busy explaining how easy is to get rid of Roo in your project, and Benīs posts about Roo (http://blog.springsource.com/2009/06/18/roo-part-3/) explain very well Rooīs motivations and internals, but maybe there are in a dificult place to find for new Rooīs users, I will try to explain why the vendor lock in is not really a problem when using Roo.
DISCLAIMER:All that I say here is only my opinion and you are free to disagree, also Iīm not part of SpringSource or Rooīs team, so I may be wrong. Ben, Stefan, please feel free to edit/remove this post any way you want.
Now that all legal issues have been adressed letīs begin with the lock in issue...
Use of ITDs makes my application AspectJ dependant
Ok, ok, so most of Rooīs generated code is on ITDs, ITDs need AspectJ... So my application will need AspectJ?.
Thatīs false, AspectJ need ends when you compile your application, you can think on Rooīs ITDs like java code in a separate file, Aspects are used only to introduce that java code into your application, but your application WILL NOT use any aspect (unless you want it) so your application WILL NOT need aspectJ in any diferent way a usual Spring application will need it for using Spring Roo.
Think in the ITDs as a tool, the same as Eclipse, you can develop with Eclipse and generate code with it, but the generated application will be completely eclipse-free, the same thing happends when you use ITDs to generate code.
Rooīs projects handle ITDs transparently, so users donīt need to know anything about weaving, the generated mavenīs pom for the project uses AspectJ compiler to weave ITD, you can be ignorant of all aspectj related stuff and use Roo at full power, the same way you can ignore how eclipse makes all that funny refactors it have but use it all the day. You need AspectJ in your compile time classpath, thatīs true, but you will not need it once you have compiled your application.
The only real problem with ITDs are that some IDEs donīt have a decent AspectJ support, and itīs possible that things like code completion could not work. In a world full of Free IDEs I donīt see it like a very big problem, moreover Rooīs projects are Maven (ant planned too) based, so you should be able to use it on any IDE. Personally I use STS, Netbeans, and Eclipse depending on the project without many problems, I donīt believe in the "One IDE to Rule them All" mantra.
Use of annotations
Ok, ok, so I donīt need AspectJ, but my classes have things like @RooToString, moreover I have some nasty org.springframework.roo... imports in my classes, and a roo annotations jar file on my classpath. What about this, eh??
Annotations could create dependencies, thatīs true, JPA for example makes your entities JPA dependant, but unlike JPA, Rooīs annotations have a SOURCE retention policy so there are not in the generated .class file.
That means, I can use any Roo annotation I want, but my compiled classes WILL NOT have any Roo annotation so I donīt need any roo annotaions jar in my appīs classpath. So my app donīt depends on Roo.
Conclusion
When I use Roo to generate any kind of application I will have a generated application WITHOUT ANY ROO DEPENDENCY, I will have dependencies at compile time, that is I will need Roo to generate the distributable format of a Rooīs application, but this is not a dependency or a lock in risk, itīs simple what happends when you use a tool, if I want to use a hammer I will need a hammer, so if I use Roo to generate an application I will need Roo at build time only.
I know many people are not comfortable with AspectJ, donīt be afraid of it, Rooīs ITD are simply java code in a separate file, that code will be in your java file and you will not need to configure anything to make it happend
The need to get Rid of Roo appears only when you need to change your toolset for example if you want to bootstrap a project and after that use something like EMACS, in that case you could have a problem with Rooīs ITDs and annotations, and in that situations is where it makes sense to use Push in refactor and say "goodbye Roo". But thatīs true for mostly everything in java: i.e maven, eclipse, ant, jpa... with the diference that other technollogys donīt usually give you something like push in refactor :)
HTH, Raúl