From 39448fddd6cb4cd2310c465d326829908edd3c24 Mon Sep 17 00:00:00 2001 From: Michael Hunger Date: Fri, 25 Mar 2011 00:53:30 +0100 Subject: [PATCH] updated aspectj-intro --- src/docbkx/reference/aspectj-intro.xml | 20 ++++++++++++++++++- .../programming-model/introducedmethods.xml | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/docbkx/reference/aspectj-intro.xml b/src/docbkx/reference/aspectj-intro.xml index 28a502536..782893e5a 100644 --- a/src/docbkx/reference/aspectj-intro.xml +++ b/src/docbkx/reference/aspectj-intro.xml @@ -31,6 +31,24 @@ Spring Data Graph uses both mechanisms internally. First, when encountering @NodeEntity or @RelationshipEntity - annotations it introduces a new interface NodeBacked. + annotations it introduces a new interface NodeBacked and RelationshipBacked. Secondly it introduces a few + fields and even more methods to the annotated class. These methods range from getNodeId() + to relateTo. + + + The even more important aspect are the advices that are put before the constructor call and around all field accesses (read and write). + The before-constructor advice is used to wire up the entity. The advices around all fields are used to intercept all reads and writes + and delegates them to the graph (setting properties, creating relationships, returning ids). + + + How is an aspect attached to a concrete class? This can be either achieved by the aspectj-compiler (ajc), that takes + source files and a number of aspects (probably packaged in libraries - like spring-aspects) and while and after compiling + the source files injects the advices at the places designated by the pointcuts. This compile-time weaving produces classes + that can perform on their own (with a small aspectj-runtime library) after being compiled. + + + There is also the possibility of load-time weaving when the merge of aspects and class files is done when the + classloader loads the class. This uses java-agent instrumentation and is currently not used and tested with Spring + Data Graph. diff --git a/src/docbkx/reference/programming-model/introducedmethods.xml b/src/docbkx/reference/programming-model/introducedmethods.xml index f0e1a156d..8840f75d0 100644 --- a/src/docbkx/reference/programming-model/introducedmethods.xml +++ b/src/docbkx/reference/programming-model/introducedmethods.xml @@ -1,6 +1,6 @@ -
+
Methods added to entity classes The node and relationship aspects introduce (via ITD - inter type declaration) several methods to the