I'm developing control system application for cnc machines. App is written in C# using Gtk library for GUI. Running on Linux and Windows. My next task is to have two GUIs instead of one for the same cnc. One GUI is smaller resolution, with less functionality and the other higher resolution with more functionality and features. At app startup it should load config file with parameter saying which GUI to create and use. At the same time I decided to move app to .net core and refactoring it to better follow SOLID principles and to be more clean.
Last few days I studied a lot of articles about N-tier apps and presentation tier patterns (MVC, MVP, MVVM), etc and I tried to think if I can use anything of this to build my app.
I also need to mention that whole GUI is builded at startup because it takes some time and it is better wait at startup than lazy load. My idea is to have some core project(tier)(not sure if I can call this business logic in my case) where I have classes keeping state of cnc and also classes for controlling cnc (i.e. movement, etc). This project should be able to control cnc by itself without GUI. Then I need presentation tier with two separated GUIs. I also need something(maybe I can call it controller) that will communicate between GUI and core project(call commands to core project, redirect obtained data to ViewModel and force View to update, etc.)
So, here are my questions:
- Are those described approaches suitable for my app?(Is any of my understandings or naming things wrong?)
- Are there any other more suitable approaches, patterns for this?
- Is it convenient to build this kind of apps in Composition root with some DI container and then just add reference to builded GUI?
- Can I use exactly any of MVC, MVP, MVVM for my case or is it nonsense? (If yes, then how do I communicate with my "core tier")
Any advice or reference are welcome.
Thank you. Marek
Aucun commentaire:
Enregistrer un commentaire