You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.