user2858174
user2858174

Reputation: 31

How runtime weaving works in Spring internally. what is core concept/design behind it

As we know Spring APO uses Runtime Weaving for weaving aspect and Impl. how Runtime Weaving is better than compile time and load time weaving?

Upvotes: 2

Views: 172

Answers (1)

a better oliver
a better oliver

Reputation: 26828

Spring AOP uses proxies. Dynamic proxies for interfaces can be implemented with the standard JDK. So it's kind of built-in. Proxies for classes can be implemented using CGLIB, which is just a matter of including a library.

This is quite simple compared to the approach AspectJ uses, as it does not require anything special to be done. But it is also limited to aspects around methods, e.g.

Upvotes: 1

Related Questions