Change propagation, AspectJ

  • Follow


Hi,I don't know much about AspectJ, but I'm wondering about something inJava like this one at http://common-lisp.net/project/computed-class.Is it possible to write some AspectJ code (and add some pointcuts,etc.) totransform:   public Integer a;into:   private ComputedState<Integer> aState = newComputedState<Integer>();   public Integer getA() {	   return aState.getValue();   }   public void setA(int a) {	   aState.setValue(a);   }and transform:  public Integer getB() {	   return getA() + 1;  }into:   private ComputedState<Integer> bState;   public int getB() {	   return bState.recomputeIfInvalidAs(new IComputation() { 		   public Object compute() { 			   return getA() + 1; 		   }	   });   }The rest is simple and could be done in Java too and may eliminatelots of listeners...levy
0
Reply levente.meszaros (36) 4/13/2007 2:45:29 PM


0 Replies
141 Views

(page loaded in 0.045 seconds)


Reply: