Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can synchronization be treated as an aspect in AOP

I understand that in AOP any cross cutting concerns such as Logging, transaction etc can be treated as an aspect and most of the AOP frameworks very well support these kind of cross-cutting concerns.

My question is,

  • Can Synchronization be treated as a crosscutting concern ?
  • If yes, are there any existing libraries (including AspectJ and Spring AOP) which support this functionality out of box ?

I searched but could not find many examples. I came across some restricted research papers (1,2) though.

like image 457
Santosh Avatar asked Nov 04 '22 13:11

Santosh


1 Answers

Just a theoretical "answer". :)

As I understand AOP, you add independent behaviours/"advices" to some "pointcuts"/"joint points". But synchronization is intended to be used tightly related with a code it manages.

I guess the way to use synchronization is if it will be attached as advice and will provide itself as a "joint point" for which other "aspects" will define some "advices".

Or you might get some kind of synchronization inside your "advices" while trying to call some "joint points".

like image 85
ony Avatar answered Nov 12 '22 23:11

ony