Finishing up the composite
“We should take a break soon,” Phoebe said. “We’ve got a lot done. We’ve got most, if not all, of our abstract base classes written. Those classes are the most important parts of our patterns. We’ve also almost finished the composite pattern. We just need to add the methods that recursively compute the weight and cost of each component.”
“To do that,” Tom said, “we just need to make two small adjustments. Open the WheelchairComponent class.”
Phoebe complied. She remembered that Kitty had left the DisplayCost
and DisplayWeight
methods for later. They presently read as follows:
protected void DisplayWeight() { throw new NotImplementedException(); } protected void DisplayCost() { throw...