I am trying to architect a stand-alone WPF desktop app, but the question could be applied to any programming framework.
This app has an UI where user interacts to send commands and receive/view output.
On the other hand this app also talks to some hardware devices. Now, this hardware devices also have a UI which user can send/commands receive output on.
The real problem is quite complex, but if I were to put it simply, I can sum up as below
- User sends a command through the main UI, which changes the state of the models, and respective response needs to be communicated to the main UI as well as to the hardware devices as needed. (The communicated response to the main UI, and to the hardware devices will be completely different)
- User interacts with the hardware UI, which changes state of the models, and respective result needs to be communicated to the main UI as well as to the hardware devices as needed.
So, below is the way I am trying to layout my architecture, and my questions are:
Is it normal to achieve duplex communication in this way by controllers and adapters taking dependency on the models, and model communicating back via events?
(Fyi, if you aren't familiar with ViewModels, it is similar to the View-Controller classes in other frameworks).