I participate in a project that is able to connect to various hardware devices on the fly. We were assigned a graphical interface with a touch screen, so we have MMI for devices.
Since any device (and any type of device) can potentially connect to our infrastructure, we decided to allow third-party device developers to create their own graphical plug-in. In fact, everything is fine and dandy :)
The real problem is that our manager wants these GUIs to be able to execute some form of control flow, and he doesn’t want us to have our own DSL. So, since we are making GUIs in WPF, they should be able to execute MSIL. This is a huge security risk, and I told him about it, but since this is a prototype, he says it well. Good good. There is another problem: an arbitrary MSIL may crash or deadlock, so we need to place it in some kind of asynchronous context. Since WPF does not allow access to the GUI for more than one thread, we are faced with a complex scenario.
Until now, I have been talking quite briefly about how to solve this. It’s best to separate the GUI part and the code part into 2 things: Raw Xaml for the GUI, and MSIL in a different code stream. Then I need to create a facade (On runtime?), To bind the GUI and MSIL together, sending calls to each other's threads.
I can do it, not a problem, but I think it is really smelly. You force other developers to use MVVM without code behind, I’m not sure if I can support all the bindings, and I don’t like that View and ViewModel are in separate threads (well, I do not mind, but I’m not sure if this can cause problems, since this design will be very transparent for plugin developers, so he would not think about making the material thread safe).
- , ? ? .