Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 890
Roman Avatar asked Jul 30 '10 12:07

Roman


People also ask

What is weaving in short?

Weaving is the process of combining warp and weft components to make a woven structure. The components... In weaving, lengthwise yarns are called warp; crosswise yarns are called weft, or filling. Most woven fabrics are made with their outer edges finished in a manner that avoids raveling; these are called selvages.

What is weaving for Class 8?

Weaving is the process of layering yarns or threads crosswise to create continuous lengths of fabric, including patterned weaves and ribbons. Spinning is the process of producing thread from raw fibers. Weaving is the process of transforming threads into cloth.

What is weaving for Class 7?

The process of arranging two sets of yarns together to make a fabric is called weaving.

What is weaving in history?

The development of spinning and weaving began in ancient Egypt around 3400 before Christ (B.C). The tool originally used for weaving was the loom. From 2600 B.C. onwards, silk was spun and woven into silk in China. Later in Roman times the European population was clothed in wool and linen.


2 Answers

Weaving is generating or editing code by directly modifying existing .class (byte-code) files. This can occur at different points in the application life cycle.

  1. Outside of JVM at compile time at packaging time
  2. Inside a JVM at class load time. after a class has been loaded.

Spring Framework uses this for AOP functionality. Eclipselink uses weaving for lazy loading or change tracking.

like image 59
MAK Avatar answered Oct 01 '22 05:10

MAK


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'.

like image 26
justkt Avatar answered Oct 01 '22 05:10

justkt