Solved

post load time weaving in java

Posted on 2014-03-25
5
705 Views
Last Modified: 2014-04-17
Post-compile: weaving is also sometimes called binary weaving, and is used to weave existing class files and JAR files. As with compile-time weaving, the aspects used for weaving may be in source or binary form, and may themselves be woven by aspects.
Load-time: weaving is simply binary weaving deferred until the point that a classloader loads a class file and defines the class to the JVM. To support this, one or more "weaving class loaders", either provided explicitly by the run-time
I was reading as above.
I have not understood clearly difference bewteen post compile,load time weaving what are advantages, disadvantages, practical uses.
please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 39958254
If you use load-time weaving the loading of your class will be a bit slower, that's the only difference with the post-compile weaving.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39973348
I never used this weaving. What is practical use of these weaving. Please advise
0
 
LVL 35

Expert Comment

by:girionis
ID: 39974291
Weaving is a technique that is used to enhance the functionality of a Java class. You do this by injecting bytecode* into a java class that manipulates a class file and adds more features to the class. For example you can weave JPA entities to add optimisation code that the programmer hasn't thought of.

Bytecode weaving can be done either post-compile (when your source files are compiled and have become a java class, then you weave the bytecode)  or during load time (when your class is loaded).

* There is also source code weaving.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39976452
any practical examples, links on this to try out. please advise
0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 39977468
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question