Challenge 1: Remove Temporal Coupling
Test your knowledge by writing code for a non-temporally coupled version of the PriceCalculator class.
We'll cover the following...
Problem statement
In the “Temporal Coupling” lesson of this chapter, a PriceCalculator class was discussed to explain the concept. Later in the lesson, we resolved the issue of temporal coupling by immutability and showed how the constructor of the PriceCalculator
and computePrice
methods could be rewritten.
Now ...