- Exercise 9.1 Logging with Strategy: Implement a logging component having at least the following methods:
error(). The logging component should also accept a strategy that defines where the log messages are sent. For example, we might have a
ConsoleStrategyto send the messages to the console, or a
FileStrategyto save the log messages to a file.
- Exercise 9.2 Logging with Template: Implement the same logging component we defined in the previous exercise, but this time using the Template pattern. We would then obtain a
ConsoleLoggerclass to log to the console or
FileLoggerclass to log to a file. Appreciate the differences between the Template and the Strategy approaches.
- Exercise 9.3 Warehouse item: Imagine we are working on a warehouse management program. Our next task is to create a class to model a warehouse item and help track it. Such a
WarehouseItemclass has a constructor, which accepts an
idand the initial...