zynthian / zynthian-issue-tracking

Centralized Issue Tracking for Zynthian Project
https://github.com/orgs/zynthian/projects/1
11 stars 3 forks source link

Move to Model-View-Controller architecture #672

Open riban-bw opened 2 years ago

riban-bw commented 2 years ago

Is your feature request related to a problem? Please describe. The current code base mixes user interface, core (backend) functionality and control within the same modules. This means the whole UI needs to be run and driven, even on a headless device. It also means alternative UI (GUI, hardware control, etc.) requires the full Zynthian GUI to run. Modifying code is more challenging due to the deep integration of these elements.

Describe the solution you'd like It would be advantageous to separate the elements to separate modules like a Model-View-Control architecture. This would simplify furture development, allow better control and support API implementation.

Describe alternatives you've considered Wrap the whole application in an API or leave as is.

Additional context I have identified these Python source files that are either GUI only, data+control only or mixed. (Note this list was compiled a few weeks ago. There may have been files added or removed recently that are not listed here.

GUI Only

Data / Control Only

Combined

I suggest we create folders for the model and control modules and separate the functionality into their own classes. This can be done methodically allowing each change to be tested and maintain overall operation.

riban-bw commented 3 weeks ago

There was some work done towards this goal within the chain manager development. We need to take this on as a dedicated target, maybe in the next development branch (Oram+1).