1

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!

4
  • Immediately you're going to run into a problem of using the webcam in a browser. That will require a third party plugin. Also, why do you send all the database cards to the client? Why not have the client take a picture, send the picture to the server, have the server hash and find a closest match. Then send that match back to the client? Alternatively, you could hash the picture on the client.
    – Prescott
    May 26, 2013 at 7:17
  • Have you thought about developing a smart phone app instead? Its just that it struck me as probably a good fit for an app, since you would have full access to the phone's hardware, including front and back facing cameras. May 27, 2013 at 7:02
  • I was afraid the webcam would force me to use a plugin. Even Facebook uses Flash, so I guess it's not all bad. Now I only have to choose between Flash, Java and Silverlight. @Prescott my app doesn't need to take still pictures, it runs the scan algorithm in real time with the video feed. I don't send the whole database, only a recordset of around 15k rows of 2 columns, 1 int and 1 char(30), so quite small. That way, the client does the hashing instead of the server. It's not a CPU intensive task, but assuming multiple simultaneous sessions, it's more efficent to have the client do it. May 28, 2013 at 1:45
  • @dodgy_coder The mobile app will be phase 2! I'm starting the project with a website to refine my skills and also define my offering. However, instead of doing a mobile version of the site, I'll go with an app. May 28, 2013 at 1:47

1 Answer 1

1

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

3
  • Thanks for your answer, although I'm afraid it raises as many questions as it answers. I think my current application has its layers well seperated, so you're right that the hard part will be the presentation layer. Why would you recommend Java over Flash of Silverlight? I guess all 3 can use the video feed to scan the cards without taking a still picture? Would you go for an all-Java interface, or HTML/CSS with a Java applet for the webcam? May 28, 2013 at 2:07
  • Personal preference really, and more experience with it. from a small bit of research I found this. I glimmer of hope for you about accessing the webcam. colorfulwolf.com/blog/2011/07/05/… This seems to be pointing to a java app that allows the use of the end users web cam. How well it works has yet to be seen. May 28, 2013 at 2:30
  • Thanks for the link, I think it might actually help. I'll start working on it this week-end and I'll let you know how it turns out. May 29, 2013 at 13:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.