This shows you the differences between two versions of the page.
caching:ex2 [2008/10/07 14:08] bdefrain |
caching:ex2 [2021/02/05 13:51] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Caching: Constant cache ====== | ||
- | ===== Using inter-type declarations ===== | ||
- | |||
- | **Task:** Pass '' | ||
- | |||
- | Instead of making the (very) conservative approximation of '' | ||
- | |||
- | <note tip> | ||
- | Use an inter-type declaration of a field on the '' | ||
- | </ | ||
- | |||
- | A correct implementation should pass the tests of suite '' | ||
- | |||
- | When done, remove the aspect from your build path before continuing with the next part. | ||
- | |||
- | ===== Using several aspect instances ===== | ||
- | |||
- | Imagine that a '' | ||
- | |||
- | Therefore, write a new version of the above aspect that does not change the fields of the '' | ||
- | |||
- | <note tip> | ||
- | Store the field in the aspect itself and use the '' | ||
- | </ | ||
- | |||
- | A correct implementation should also pass the tests of suite '' | ||
- | |||
- | When done, remove the aspect from your build path before continuing with the next part. | ||
- | |||
- | ===== Reusable caching aspect ===== | ||
- | |||
- | A // | ||
- | |||
- | * The type of the cache value: i.e. '' | ||
- | * The operation being cached: i.e. '' | ||
- | |||
- | Then reimplement your solution using this generic caching aspect. The new implementation should still pass the tests of suite '' | ||
- | |||
- | ---- | ||
- | |||
- | Keep the last of your caching aspects active and continue with [[caching: |