How expensive is it to invoke CtClass.instrument() ?

I'm developing some new AOP-ish things for Tapestry. The enhancements must 
occur to the live class at runtime, since the configuration is not known until 
then.

I'm prototyping right now.  For starters, most instance variables are going to 
be encapsulated with private instance methods that handle some additional 
concerns.    That is, accessing instance variable _foo will change to invoking 
_$read_foo() or _$write_foo(). This was easy enough to code in my prototype, 
but started me thinking in terms of classes with perhaps a dozen or more such 
changes (and possibly many dozen such changes in some scenarios). 

I'm using instrument() with an ExprEditor.

Is it more efficient to create an ExprEditor for each individual instance 
variable and execute instrument() multiple times?  Is it more efficient to 
create a single, smarter ExprEditor for all instance variable changes, and 
invoke instrument() just once?    

The latter is slightly harder to code, so I only want to do it if it is useful, 
if there's an appreciable difference.  Guideance?



View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3920323#3920323

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3920323


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to