Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Intertype Declaration for only one target ?!?!?!?

Me again,

Lesiecki Nicholas wrote:

> I like the limitation personally. Consider:
> 
> public int Employee+.foo = 10;

yes, but consider:

public void VisitedElement+.accept(Visitor v) {v.visit(this);}

Great! Using more than one target for an introduction is not always that
bad....

I doubt that the benefit of restricting member-introductions to only one
target is such a help as expected. In fact it confuses the type-system
somehow. The intention is, that the static type of "this" can be
determined at compile-time. However.........in fact the limitation does
NOT determine the static type. It just says something like "this is at
least of type ...".

So transforming the code above to:

  public void VisitedElementInterface.accept(Visitor v) {v.visit(this);}
  declare parents: (MyTree+) implements VisitedElementInterface;

does _not_ mean (if I understand it right and in case this code still
works) that "this" has the static type "VisitedElementInterface", but
"at least VisitedElementInterface". 

-Stefan

PS: I (shortly) discussed the binding of this in my AOSD'03 paper.
Yes.....I think it is necessary to restrict the "anarchical usage of
introductions" somehow. But my personal opinion is, that the usage of
traditional interfaces for the purpose of typechecking is not the right
way (....just a personal opinion).

PSPS (@Jim): Still scared....but not that much......;-)


Back to the top