Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] ITD syntax

I've been wondering recently.... is there a reason that ITDs are defined the way they are? I don't know how others tend to use them, but for me I'm pretty likely to have an aspect that contains ITD fields and methods that apply to a single interface within a given aspect. This makes me wonder why we have a syntax like:

public aspect ITDAspect{

	private String ITDInterface.string;

	public String ITDInterface.getString(){
		return string;
	}

	public void ITDInterface.setString(String string){
		this.string = string;
	}

}

Instead of:

public aspect ITDAspect{

	intertype(ITDInterface){


		private String string;

		public String getString(){
			return string;
		}

		public void setString(String string){
			this.string = string;
		}

	}
}

Or something similar. Something that involved less typing, consolidated code that is defined for another type and looked more like plain java code (not to mention more like other AJ definitions in this case....). At the very least it would allow for something that I've wanted many times: cut and paste between classes and ITDs without having to post process with some sort of wacky regex. Am I missing a reason why it's desirable or even necessary to type out the full interface name on each line?


Back to the top