You are designing a remote for controlling devices in your home. Currently, you have a single device you want to control: color-changing light panels. You are planning on adding more devices in the future.
There are currently three commands you want to send to the panels:
- on,
- change brightness to 10 (dim), and
- change color to blue.
Leverage the Command pattern to design a RemoteControl class that controls devices. Configure the remote to control your color-changing light panels. The remote should be able to undo the three most recent commands issued.
- Recall or research what the heck the Command Pattern is.
- Add a main method to your RemoteControl class demonstrating
- the construction of a remote,
- execution of the three color-changing light panel commands (on, change brightness to 10 (dim), and change color to blue),
- undoing the three most recent commands issued.
Thanks to Callum Curtis for creating this example.