|
From: <rod...@in...> - 2003-06-13 15:45:53
|
<juergen> In the course of my interceptor tests, I've noted that the AOP ProxyFactoryBean still takes comma-separated interceptor names for building the chain. Couldn't we change that to proper refs? The only issue I see is that "*" is also supported, for applying all "global" interceptors. But we should be able to mix refs and values in lists anyway, shouldn't we? </juergen> They actually need to be Strings. I know I implied otherwise at one point, but the ProxyFactoryBean will always depend on the BeanFactory because if an AOP-enabled object is a prototype it needs to create an independent interceptor chain each time it creates an instance. If any of the interceptors is also a proxy, a new instance will need to be created. So Strings must remain, but I think we can get rid of the CSV. The current XmlBeanFactory should accept a String[], with the normal <list> syntax (conversion is automatic in AbstractBeanFactory). No refs will be involved. I did mean to do this, but I doubt I'll have time before we release. String [] won't work yet in the properties parsing in ListableBeanFactoryImpl but I'm planning to fix that before 1.0. <juergen> Regarding global interceptors: Currently, all interceptor definitions whose name starts with "g_" get applied on "*". This is a bit strange, as "g_" could effectively mean global objects of any type. I'd suggest to introduce a "xxx*" syntax instead of "*", so that one can specify any name prefix for definitions to apply. Obviously, the current pattern would be achieved by "g_*" then. </juergen> Nice solution. Definitely an improvement. <juergen> So ProxyFactoryBean's strategy could be as follows: Take a List of interceptors instead of a comma-separated String of names, and treat everything except String elements as interceptor or target object. A String element would mean a global interceptor pattern like "global*". As a target object would never be a String anyway, this shouldn't cause any restricitions. Is there a better solution for the global stuff? </juergen> We could maybe have a mixed-type list of Interceptor/Pointcut (refs, only appropriate for singleton interceptors), String (name enabling lookup when creating an instance) and ref (target). But the String[] solution is simpler and I think we should just go for that now. Regards, Rod |