Spring documentation recommends putting @Transactional annotation in a specific class / method, rather than an interface. The reason for this is multiple stack overflows, for example:
Where should I put the @Transactional: annotation in the interface definition or in the implementation class?
Spring Security @ Delayed behavior is different; most of the documentation shows the placement of annotations on the interface. Actually, it looks like you are working with an interface annotation or a specific class and regardless of whether you use JDK or CGLib proxies.
This seems like an excellent solution. So why inconsistency? One answer to the aforementioned question suggests the impact of performance ... but, of course, performance is just as important for security ?!
And how does @Secured solve the problem of diamond inheritance (the class implements 2 interfaces, both have @Secured the same method in different ways)?
source share