Re: [Meinds-developers] Aspects con's
Brought to you by:
emcs,
rickardoberg
|
From: Rickard <ri...@xp...> - 2001-11-30 13:15:59
|
Rickard Öberg wrote: > First of all, the most obvious problem: it is not possible for an > AOP-object to implement interfaces with methods that clash. I.e. you > can't have interfaces A and B that both have "String getName()" methods > in them. If they have different method signatures it's ok. This may not > be a big problem in reality, but it's something to watch for. Actually, this can be easily solved by explicitly narrowing the object. Example, an object obj has two aspects A and B which both have a method getName(). Invoking obj.getName() will always delegate to A.getName() (even if the object was casted to B) since the proxy can only implement one of the two methods. However, if one explicitly casts it like this: B bObj = ObjectFactory.getObject(obj, B.class); // Narrow it bObj.getName(); // Invoke B aspect with getName() This will allow an object to have aspects which have the same method signatures. /Rickard -- Rickard Öberg |