7

i've been running some experiments of my own with Spring Roo and it seems to be pretty cool, but i noticed that this tool makes heavy use of AOP on the model layer.

I'm thinking about creating a real project using Roo and what i would like to know is:

  • Why AOP is everywhere? Is that ok?
  • What are advantages and disadvantages of this approach?

I'm quite new to aspect-oriented programming and some guidance would be greatly appreciated.

skaffman
  • 398,947
  • 96
  • 818
  • 769
marcosbeirigo
  • 11,098
  • 6
  • 39
  • 57

3 Answers3

2

The Spring Framework has extensive AOP capabilities, and it makes sense to use these in Roo-based applications. AOP allows you to make a nice and clean separation between business logic and system logic. When done properly, you get a more maintainable and understandable codebase.

The disadvantage is a small performance hit, but not enough of one to make me worry about it.

To learn more about Spring and AOP, have a look at the docs. Spring uses AOP for things like transaction management and asynchronous operations.

edit: As @chedine rightly pointed out, the AOP is compile-time weaved, so the usual AOP performance hit does not apply.

Steffen Opel
  • 63,899
  • 11
  • 192
  • 211
skaffman
  • 398,947
  • 96
  • 818
  • 769
2

I think, there will not be a performance hit in case of Spring ROO. Since it uses compile time weaving and all aspects are introduced during compile time.

chedine
  • 2,384
  • 3
  • 19
  • 24
1

The disadvantages are addressed in this related SO question: What are the disadvantages of Aspect-Oriented Programming (AOP)?

0x5C91
  • 3,360
  • 3
  • 31
  • 46
chedine
  • 2,384
  • 3
  • 19
  • 24