April 2019
Intermediate to advanced
360 pages
9h 17m
English
We will demonstrate the implementation of the caching design pattern with a simple example. We will create a Player class that is used to record a basketball team's all-time top scorers. We will create a pairing with jersey numbers and total points. We will also have an ExampleCache class and a ClassDriver class.
The Player class is provided next. It has four class variables and a constructor method:
public class Player { int playerJersey; int playerPoints; Player before; Player next; // constructor public Player(int jersey, int points) { this.playerJersey = jersey; this.playerPoints = points; }}
The ExampleCache class is presented in five sequential segments. The first segment contains the ...
Read now
Unlock full access