User Tools

Site Tools


caching:ex1

Differences

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

Link to this comparison view

Next revision
Previous revision
caching:ex1 [2007/02/26 18:22] – created bdefraincaching:ex1 [2021/02/05 13:51] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Caching: Constant Override ======+[[caching:intro|Intro]] 
 +[[caching:ex1|Ex1]] 
 +[[caching:ex2|Ex2]] 
 +[[caching:ex3|Ex3]] 
 +[[caching:ex4|Ex4]]====== Caching: Constant Override ======
  
 **Task:** Pass ''tests.BoundsConstant''. **Task:** Pass ''tests.BoundsConstant''.
  
-The ''getBounds()'' method of a ''Group'' could be understood to be a conservative approximation of the bounding box of a group. If that is true, then it would be a legal (and much faster) implementation of ''getBounds()'' to simply always return a rectangle consisting of the entire canvas. The entire canvas is returned by the static member ''FigureElement.MAX_BOUNDS''. Write an aspect to implement this change.+A first, very crude approximation of the bounding box, would be to return the entire drawing canvas. This is certainly very fast to calculate (it is a constant value), although it might mean excessive redrawing. 
 + 
 +Implement an aspect to return the entire canves when the ''getBounds()'' method of a ''Group'' is invoked. The entire canvas can be retrieved through the static field ''MAX_BOUNDS'' of ''FigureElement''.
  
 <note tip> <note tip>
Line 9: Line 15:
 </note> </note>
  
-This should make the test cases of tests. BoundsConstant pass.+This should make the test cases of ''tests.BoundsConstant'' pass.
  
 ---- ----
  
-When done, remove the aspect from your build path. Continue with [[caching:ex2|Exercise 2]]+When done, remove the aspect from your build path. Continue with [[caching:ex2|Exercise 2]].
caching/ex1.1172510550.txt.gz · Last modified: by bdefrain