Solved

post load time weaving in java

Posted on 2014-03-25
5
685 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

760 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now