Skip to content

UVic-Data-Science-for-SE/command_exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

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.

Criteria

  1. Recall or research what the heck the Command Pattern is.
  2. Add a main method to your RemoteControl class demonstrating
    1. the construction of a remote,
    2. execution of the three color-changing light panel commands (on, change brightness to 10 (dim), and change color to blue),
    3. undoing the three most recent commands issued.

Credits

Thanks to Callum Curtis for creating this example.

About

Implement the command pattern

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages