This content has been marked as final.
Show 6 replies
-
1. Re: Some questions/suggestions
bill.burke Oct 14, 2004 9:51 PM (in response to charles_blaxland)"charles_blaxland" wrote:
I've been writing some aspects with JBoss AOP and I like it a lot so far :)
Some questions/suggestions:
- The "within" scope limiter doesn't seem to work with field/set/get pointcuts? Should it?
I'll add this to the list. So, the answer is no, it doesn't work right now.
- It appears that you can't refer back to a previously defined typedef when defining an introduction? (ie: in a similar way to how you can refer back to a previous pointcut definition when defining an interceptor). What I would like to write is:<typedef name="FooTypes" expr="class(com.acme.foo.*)"/> <typedef name="BarTypes" expr="class(com.acme.bar.*)"/> <introduction expr="FooTypes OR BarTypes"> ... </introduction>
But this doesn't seem to work.
looks like a bug. We'll get on it.
- The library I'm writing (persistence framework of sorts) relies on both an interceptor and a mixin being applied to every class that will be made persistent. I want to simplify the setup of this as much as possible for the end user of my library. Ideally, all they would have to specify is a list of classes they want to persist, and my system handles setting up the appropriate jboss pointcuts and introductions programatically. I want to avoid the user having to mess around with jboss-aop.xml if possible.
Although I haven't tried it yet, I think pluggable-pointcuts will let me mostly achieve what I want. However they don't go quite far enough, in that you can't have pluggable introduction typedefs. So what I'm suggesting is <pluggable-typedef> element that behaves in much the same way as pluggable-pointcut. Thoughts?
Sounds like a good idea. I think we can implement this.
- It would be useful if all fields and methods introduced into a class by JBoss AOP had some kind of unambiguous token in their name so they can be easily picked out when using reflection. At the moment most of them have "aop$" in their name, but not all.
Does this work for you???
http://docs.jboss.org/aop/aspect-framework/misc/reflection.html
Bill -
2. Re: Some questions/suggestions
charles_blaxland Oct 14, 2004 10:16 PM (in response to charles_blaxland)Great, thanks Bill!
"Bill Burke" wrote:
Does this work for you???
http://docs.jboss.org/aop/aspect-framework/misc/reflection.html
Cool - this is very nice and will do exactly what I want :-)
Out of curiosity, is there much overhead in adding global call/field pointcuts (ie: not limited by a "within" or similar)? I'd imagine this would require crawling the bytecode of every class loaded, which sounds expensive (although I'm not familiar with what you can do with Javassist, so maybe this is not so bad as it sounds?).
Thanks,
Charles -
3. Re: Some questions/suggestions
bill.burke Oct 14, 2004 10:26 PM (in response to charles_blaxland)If you use load time transformation, then yes, it is definately more expensive to have caller pointcuts although I haven't done any measurements. If you use the AOP precompiler, doesn't really matter how slow it is...
Bill -
4. Re: Some questions/suggestions
bill.burke Oct 14, 2004 10:29 PM (in response to charles_blaxland)BTW, feel free to advertise the aspects you are writing on our WIKI.
http://www.jboss.org/wiki/Wiki.jsp?page=ContributingYourOwnAspects
Bill -
5. Re: Some questions/suggestions
kabirkhan Oct 15, 2004 1:56 PM (in response to charles_blaxland)Hi there,
Regarding this:"charles_blaxland" wrote:
- It appears that you can't refer back to a previously defined typedef when defining an introduction? (ie: in a similar way to how you can refer back to a previous pointcut definition when defining an interceptor). What I would like to write is:<typedef name="FooTypes" expr="class(com.acme.foo.*)"/> <typedef name="BarTypes" expr="class(com.acme.bar.*)"/> <introduction expr="FooTypes OR BarTypes"> ... </introduction>
But this doesn't seem to work.
In RC2 this works:<typedef name="FooTypes" expr="class(com.acme.foo.*)"/> <introduction class="$typedef{FooTypes}"> <interfaces> java.io.Serializable </interfaces> </introduction>
I've just added to cvs the ability to do:<typedef name="FooTypes" expr="class(com.acme.foo.*)"/> <typedef name="BarTypes" expr="class(com.acme.bar.*)"/> <introduction expr="class($typedef{FooTypes}) OR class($typedef{BarTypes})"> <interfaces> org.jboss.test.aop.basic.EmptyInterface </interfaces> </introduction>
Hope this helps.
Cheers,
Kabir -
6. Re: Some questions/suggestions
bill.burke Oct 15, 2004 4:56 PM (in response to charles_blaxland)On "within" + get/set. This is not possible. We will look to adding this after the 1.0 release.