View Full Version : AttributeMatchMethodPointcutAdvisor ?
10-21-2005, 10:29 PM
There is a AttributeMatchMethodPointcut class, but no AttributeMatchMethodPointcutAdvisor ?
Is there a reason ?
I added one, and it seems to work.
Anyway, can we associate Pointcuts to advices in config file without advisors classes ?
10-21-2005, 11:20 PM
I guess it would make sense to add one to allow for simple attribute-based aspect definition, but I never got to it because it's not really necessary. You can easily define any advisor using DefaultPointcutAdvisor as in the example below:
<object id="cacheAspect" type="Spring.Aop.Support.DefaultPointcutAdvisor, Spring.Aop">
<object type="Spring.Aop.Support.AttributeMatchMethodPointcut, Spring.Aop">
<property name="Attribute" value="Spring.Attributes.CacheAttribute, Spring.Core"/>
<property name="Advice" ref="aspNetCacheAdvice"/>
As a sidenote, I will be working on a greatly simplified AOP configuration soon, which should make a number of these things obsolete from the end user perspective.
In the meantime, if you can email me the advisor you implemented I will be more than happy to review it and check it in.
10-22-2005, 04:10 PM
Maybe u should add a sample using DefaultPoincutAdvisor in the documentation.
i got something like that with the advisor that i sent u :
<object id="AspNetCacheAdvice" type="Spring.Aop.Support.AttributeMatchMethodPointcutAdv isor, Spring.Aop">
<object type="Aspect.AspNetCacheAdvice, Aspect"/>
<property name="attribute" value="Framework.AspNetCacheAttribute, Framework" />
I was testing Spring.Aop with a generic AspNetCacheAdvice, that u can configure with a method Attribute (timespan, priority, etc...).
But i see with ur sample there will be the same in Spring.Web.
10-22-2005, 08:31 PM
Cool, I got your email, will look at the advisor and check it in.
Yes, there is already cache advice in the framework (as of Web Preview release), which is implemented as a strategy in order to be able to plug in different caching solutions. Right now there are two implementations in CVS -- AspNetCacheAdvice within Spring.Web, and another within EntLib integration that uses Caching Application Block instead.
Second one is interesting because it allows you to persist cached objects on a disk (as long as they are serializable), and it also works within applications other than web apps.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.