Skip to content

Latest_release_Blus

Latest

Choose a tag to compare

@Tang-Moyan Tang-Moyan released this 26 Oct 13:11
Command classes: extract command functions into classes

Command functions (todo, deadline, event...) have some
common behaviors (return a message).

Common behaviors should be abstract out for better OOP practice.

Abstracting out common behaviors into a super class and making each
command function a separate class allow more conveninent extensions
of current commands in the future.

Let's have a super class Command and define all commands as child
classes of the Command class.

Using inheritance is preferable over composition in this situation
because the common behaviors are not composable.