Skip to main content

Weaving

Simple Story

The teacher has to be in place before a pupil reaches for anything. This page is about how they get there.

One way puts the teacher beside the pupils' hands before the examination starts. The other puts them beside each worksheet, telephone and other thing as it comes into the room. The second reaches places the first never sees, such as the inside of the permitted aids. The two ways still do not catch exactly the same things.

Who is who

What it is​

Weaving is the act of inserting advice at matched join points. It can happen:

  • at compile time, by a special compiler that emits already-woven bytecode;
  • at load time, by an agent that rewrites each class as the Java Virtual Machine (JVM) loads it;
  • at runtime, by redefining classes that are already loaded.

The two backends Ares supports sit at different points on that scale. AspectJ weaves the call sites it can see. Load-time instrumentation rewrites classes as they are loaded, including classes Ares never compiled.

This difference is the reason the two backends are not interchangeable in their guarantees, and the reason continuous integration (CI) runs both.

Further reading​