C# Web Development – Simple Way to Deploy Winform Application to Website

cPHPwebweb-development

First of all, I know there is no perfect answer to my question. It is a bit personnal, but I'm sure many programmers face the same dilemma when they get from regular desktop applications to client/server web applications: what is the "best" language/framework to use? There are a lot of great solutions out there, all having more or less the same advantages and features. So, I would like an advice based on my needs and background.

I'm fairly experienced with VB and PHP, and I have some Javascript and C# knowledge. I currently have a perfectly functionnal C# Winform app that I would like to deploy to my website. The application uses the user's webcam to recognize a game card through a perceptual hashing algorithm and displays details of the best matched card from a MySQL database. Here's how I'd like the web version to perform:

  • the server sends a recordset of the whole datebase's cards ID/hash matches to the client
  • the client "scans" his card with his webcam and creates a hash
  • the client searches for a match between this hash and the ones in the recordset
  • the client returns the best match to the server
  • the server displays information of the card from the database

My objectives :

  • limit (if possible) the need for the user to install 3rd party software (flash, java, activex or other plugins)
  • create a solution that integrates well in a Windows/Apache/PHP environnement
  • create a solution that is, ideally, cross-platform
  • using a language/framework combination on which it's simple to write, debug and maintain code

So far, I'm eyeing Python on Eclipse or Javascript on Visual Studio. I read interesting stuff about Ruby on rails, but the learning curve might be a bit steep for me. I don't mind learning a new language and coding the app again from scratch, but I'd like as much as possible to use the skills and code I already have.

Any thoughts? Thanks!

Best Answer

I have an immediate concern with the webcam. Sadly I am not sure this is possible without the use of third party apps like flash or java. Not to say those are bad ideas. You might want to consider the use of JAVA for this.

With that in mind lets talk about converting your current c# winforms app to a web app. One of the core concepts of programming is seperation of concerns.

This means you have your application divided into three conceptual layers. They are the Data Access Layer, the Business Logic layer, and the presentation layer. The data access layer is for data access, db acccess and general getting of data. The business layer is for accessing the data layer, grabbing the data (without caring about how it got the data) and manipulate the data and then passes that onto presenation layer. Whichs responsiblity is for end user interaction.

Lets pretend you did this or something like this when developing your application. That means all that is yet to do is to redesign the presentation layer to be web exposed as opposed to winforms exposed. The front end is always (in my opinion) the hard part. So this will not be fun, but could be useful.

the problem you will most likely face is the input/output differences between winforms and web sites. You lose a lot of easy to get to direct stuff with winforms when you do this. Alot of it can be done in different ways using a combination of html5, css and javascript.

You can also bridge the gap with a java based front end that calls on your .net backend. So there are plenty of options for you.

Good luck

Related Topic