简体   繁体   中英

Web interface for Windows Forms Application

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM