Re: [Meinds-developers] Aspects: pro's and con's
Brought to you by:
emcs,
rickardoberg
|
From: Dmitri C. <di...@bi...> - 2001-11-30 11:33:58
|
On Fri, 30 Nov 2001, Rickard [ISO-8859-1] =D6berg wrote: > 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. 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 need to have a common interface (Individual) it doesn't really work... 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? 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...? cheers dim |