Re: [Meinds-developers] Aspects: pro's and con's
Brought to you by:
emcs,
rickardoberg
|
From: Rickard <ri...@xp...> - 2001-11-30 12:31:11
|
Dmitri Colebatch wrote: > When I first started thinking about the aspect oriented thing I was > actually wondering if I could just have a "resource" that is basically > just an object, and then cast it to anything (which it may not have been > assigned at compile time), and have the dynamic proxy implement > isAssignableTo or something like that... so if I was invoking the > getName() on the User interface it would go to a different interceptor > than if I invoked it on the ACL interface. That is precisely how it works. > However, because we still need > to have a common interface (Individual) it doesn't really work... No, there's no "need" ;-) I just happened to make such an interface, to make it easy to see what aspects an Individual could have, by default. If you want, try removing ACL from Individual, and change IndividualBuilder to use the interfaces Individual+ACL instead. Same effect. > now... thinking about this, whilst Java requires that we have the common > interface, in Interceptor.invoke you test for getDeclaring class... could > we not have a chain of interceptors for each aspect rather than each > interface, so rather than IndividualBuilder creating the chain, > Interceptor did it? This is how it already works ;-) ACLBuilder sets the ACLImpl interceptors, the MemberBuilder sets the MemberImpl interceptors, and so on. IndividualBuilder is only responsible for either the interceptors that should go for only the object, or for the object and all aspects. /Rickard -- Rickard Öberg |