Re: [Meinds-developers] Aspects: pro's and con's
Brought to you by:
emcs,
rickardoberg
|
From: Dmitri C. <di...@bi...> - 2001-11-30 11:51:40
|
On Fri, 30 Nov 2001, Dmitri Colebatch wrote: > On Fri, 30 Nov 2001, Rickard [ISO-8859-1] =D6berg wrote: >=20 > > First of all, the most obvious problem: it is not possible for an=20 > > AOP-object to implement interfaces with methods that clash. I.e. you=20 > > can't have interfaces A and B that both have "String getName()" methods= =20 > > in them. If they have different method signatures it's ok. This may not= =20 > > be a big problem in reality, but it's something to watch for. >=20 > 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. However, because we still nee= d > to have a common interface (Individual) it doesn't really work... >=20 > 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? >=20 > So when Interceptor gets the call, it knows through config what > interceptors to actually use, and you can have a different interceptor > chain for each different aspect...? I've just realised a problem with this... the common interface... you would have to do without the common interface for this to work, which means that its not too dissimilar to how it is now really... you just get a new aspect...=20 maybe we could have a method getAspect(Object resource, Class aspect) where the class is the interface represneting the aspect (and hence interceptors/behaviour) that you want...? I'm kinda tired atm... so probably not thinking straight... well, thats my excuse and I'm sticking to it (o: maybe I'll realise how silly this all sounds tomorrow! cheers dim |