I need to add a web interface to a Windows Forms application. In fact the application just has one form containing some standard controls (buttons, trackbars, etc..) that are sending commands via the Serial Port to a microcontroller.
Now i need to have more or less the same form also available as Web interface. What is the best way to achieve this?
Decouple all business logic and objects from the UI and put that into a library assembly of its own (call it Domain, for example).
Do the same with all data access routines.
Use these libraries in your winforms application and develop a new web application against them.
This is a common pattern, when you separate the business rules and data access to their own assemblies to decouple them from your UI, allowing you to write different UI's that conform to the same set of business rules and data layer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With