views:

70

answers:

2
+5  Q: 

What is 'weaving'?

I've seen this term when read about how Spring works and I've just read the article about JPA implementation performance and it has the next statistics:

EclipseLink                                                           3215 ms
(Run-time weaver - Spring ReflectiveLoadTimeWeaver weaver  )
EclipseLink (Build-time weaving)                                      3571 ms
EclipseLink (No weaving)                                              3996 ms

So, could someone explain in plain English, what is weaving?

Thanks!

+3  A: 

weaving is about changing your classes, adding some new bytecodes to them, during build time (after compile) to make them useable for framework or ....

mohammad shamsi
this operation can be done during load time too, it's not just in build time.even i read somewhere that it can be before compile but i'm not sure about this though
mohammad shamsi
+2  A: 

From here:

In Spring AOP makes it possible to modularize and separate logging, transaction like services and apply them declaratively to the components Hence programmer can focus on specific concerns. Aspects are wired into objects in the spring XML file in the way as JavaBean. This process is known as 'Weaving'.

justkt