User Tools

Site Tools


caching:ex1

This is an old revision of the document!


Caching: Constant Override

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.

You can override the getBounds() method entirely with around advice intercepting the method.

This should make the test cases of tests. BoundsConstant pass.


When done, remove the aspect from your build path. Continue with Exercise 2

caching/ex1.1172510550.txt.gz · Last modified: 2007/02/26 18:22 by bdefrain