Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it feasible to convert a desktop based MFC C++ application to a web app

I have a very large app, 1.5 million lines of C++, which is currently MFC based using the Document/View architecture. The application includes a lot of 3d vector graphics, spreadsheets, and very many dialogs and Windows. Within the constraints of the DVA it is fairly well written, in that there is no significant program logic in the user interface, and anything that can be done using the user interface can also be carried out programmatically using a COM/OLE Automation interface.

At the request of a number of users, I have been toying with the idea of creating a browser interface to the program, where the program itself runs on a server. Thoughts so far are convert all the COM interfaces to DCOM and rewrite/port the UI to Java. Initial experimentation shows that this will be a huge amount of work.

Anyone else out there got any ideas for an easier implmentation? Anyone come across any refactoring or similar tools specifically to help this kind of a port?

like image 833
SmacL Avatar asked Jan 11 '09 14:01

SmacL


Video Answer


1 Answers

The short answer is that it is feasible, don't use java, and that it will be a considerable amount of work.

A good few years ago (around the time of IE5) I was asked by a client to answer a similar question to this one. The application in question was a well structured three tier desktop application.

The upshot of the study was that it is possible. The options considered were Java, and CGI, using either CORBA or COM/DCOM. Building a Java applet was considered, but ruled out because it wouldn't have been too different to the C++ desktop version.

The approach taken was to take the backend tier and turn that into a server application sitting behind a cgi layer. The UI was largely re-written using what we now know as Ajax, i.e. Javascript and HTML. The UI was split between browser elements and server elements.

I did consider writing a tool to convert documents, views and dialogs and wrapping these into a compatible format, however after much analysis it became obvious that it wasn't really feasible to do this because the MFC is actually quite closely coupled to the Win32 API, and itself. Depending on the amount of dialogs it may be worth writing something to convert these.

I did find, that even in a well structured system that a fair bit of code that should have been in the backend had leaked into the front end.

If I were to do the same thing now, there are some excellent javascript libraries that would help, but I'd still take the same approach of doing as much as possible in the browser using Ajax, with possibly something like qooxdoo or YUI. I'd also probably move look at using XUL and moving at least most of the dialogs into the backend.

The only thing that concerns me from your list of requirements is the 3d vector graphics, although there maybe some mileage in this JS toy or JS3D.

This is only a brief summary, as I'm trying to avoid writing a dissertation.

like image 111
Richard Harrison Avatar answered Sep 22 '22 01:09

Richard Harrison