• 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

AOP in Spring 5

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

Aspect Oriented Programming seems to have quite a bit of promise, and Spring appears to support it.  But there is very little guidance on how to do it, especially if you compare it to other topics like Spring Data or Spring Web MVC, (which I understand are much more popular topics).

Do you have any recommendations for reading on when you might use AOP (other than logging, please), and more to the point, how you would implement it in Spring 5?

Thanks!
Keith
 
author
Posts: 469
20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Keith,

The book has a specific chapter on AOP that covers all aspects of Spring's support for AOP. If you read the chapter, you'll get the idea that AOP is used wherever there are cross-cutting concerns.

regards
Ashish
 
Bartender
Posts: 1156
20
Mac OS X IntelliJ IDE Oracle Spring VI Editor Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is the idea behind AOP is to address two major issues with code; code scattering and code tangling.  

Logging, transactions, security, debugging, diagnostics would be candidates.
 
Saloon Keeper
Posts: 27861
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Rooke wrote:My understanding is the idea behind AOP is to address two major issues with code; code scattering and code tangling.  

Logging, transactions, security, debugging, diagnostics would be candidates.



Cross-cutting.

The normal organization of a system's functions is a hierarchical tree (Directed Acyclic Graph), working from the top down. With AOP, you go sideways instead.

A tree can have only one root. You can, however, have many aspects, as you've noted.

To simplify the application of aspects, one defines templates and uses a code processor to apply them to existing code. This can be done either at the source code level (which means basically writing an entire compiler) or by weaving into the generated bytecodes - which avoids having to do a lot of lexical scanning, parsing, and digestion.

In a sense, Java annotations also embody AOP, but you have to manually attach them to the code in question.

Spring itself has several function sets that lend themselves to the aspect-oriented approach. So what Keith really wanted to know is how Spring 5 changes them.
reply
    Bookmark Topic Watch Topic
  • New Topic