Encapsulate the Data


Recipe image

Goal:

Encapsulate the member variables and prevent them from being adversely changed.

Steps:

  1. Change all of the member variables to have a private or protected access modifier.
  2. Make getters and setters for every member variable.
  3. Place constraints on every member variable's setter as described in the comments
  4. Get all JUnit tests to pass.