User Tools

Site Tools


caching:ex4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
caching:ex4 [2007/02/26 18:50]
bdefrain
caching:ex4 [2021/02/05 13:51] (current)
Line 1: Line 1:
-====== Caching: Invalidate (part II) ======+[[caching:intro|Intro]] 
 +[[caching:ex1|Ex1]] 
 +[[caching:ex2|Ex2]] 
 +[[caching:ex3|Ex3]] 
 +[[caching:ex4|Ex4]]====== Caching: Invalidate (part II) ======
  
 **Task:** Pass ''tests.Invalidation2a'' and pass ''tests.Invalidation2b''. **Task:** Pass ''tests.Invalidation2a'' and pass ''tests.Invalidation2b''.
Line 6: Line 10:
  
 <note tip> <note tip>
-Store the enclosing ''Group'' as a newly introduced field of a ''FigureElement'' (intercept the ''add()'' method of ''Group'' to populate this field). When the ''FigureElement'' moves, the cache of its enclosing group should be invalidated.+Store the enclosing ''Group'' as a newly introduced field of a ''FigureElement'' (intercept the ''add()'' method of ''Group'' to populate this field). When the ''FigureElement'' moves, the cache of its enclosing group should be invalidated (if there is an enclosing group and if there is a cache value for this group).
 </note> </note>
  
-A correct implementation should at least pass the tests of suite ''tests.Invalidation2a''. However, check if you really did it correctly by also running the suite ''tests.Invalidation2b''. If you pass, congratulations! Otherwise, you have fallen prey to our cruel trap: Remember that whenever a point moves it should invalidate the caches of //all// enclosing groups (recursively).+<note warning> 
 +If you use ''aspectOf'', but no corresponding aspect instance can be found, the AspectJ runtime will throw the [[http://www.eclipse.org/aspectj/doc/released/runtime-api/org/aspectj/lang/NoAspectBoundException.html|NoAspectBoundException]]. 
 +</note> 
 + 
 +A correct implementation should at least pass the tests of suite ''tests.Invalidation2a''. 
 + 
 +However, check if you really did it correctly by also running the suite ''tests.Invalidation2b''. If you pass, congratulations! Otherwise, you have fallen prey to our cruel trap: Remember that whenever a point moves it should invalidate the caches of //all// enclosing groups (recursively).
  
 ---- ----
caching/ex4.1172512242.txt.gz · Last modified: 2007/02/26 18:50 by bdefrain