samuelbryant / sjb-tools

A simple CLI program to create, maintain and edit todo lists
MIT License
0 stars 0 forks source link

[Refactor] Split out program logic from main.py #17

Closed samuelbryant closed 6 years ago

samuelbryant commented 6 years ago

Main.py should really only handle reading commands and arguments. The actually program behavior should be put into a new file, workflow.py.

I should take the time to describe in detail the separation of labor. But roughly it works like this:

classes.py: responsible for containing data and doing primitive operations workflow.py: responsible for doing all application logic that should be exposed to the outside world (the public methods here should be 1-1 with the API) main.py: the command line frontend to interact with workflow.py's commands

samuelbryant commented 6 years ago

For now I don't want to change this just yet. The workflows require user interaction, which for now must assume that the user is accessing through the command line so it doesn't make sense to decouple main.py from the workflows since we want to encapsulate all CLI stuff into main.py