Porting a C++ application to a Web application

  • Thread starter Bartholomew Simpson
  • Start date
B

Bartholomew Simpson

I wrote a desktop application in C++ a little while ago, and I will like
to port it to a web application.

Here are the details:

1). ALL business logic is held in ANSI C++ libraries (e.g. I make
extensive use of the BOOST C++ libraries)
2). The front end is written entirely in VB6

What I want to do is to is to be able to be able to have a choice of
building a desktop application or a web application (from near enough,
the same GUI code as possible).

I realize that I will have to port the GUI from VB6 to either C# or
VB.Net (I can code in either language easily enough). I would like to
know if :

1). I can build both a web application and a desktop application from
the same (presentation layer) source code - if no, what is the best way
to minimize duplicating code?

2). Which of the two languages (VB.Net or C#) will be better suited for
this job (i.e. coding a new presentation layer), and why ?
 
B

Ben Rush

1). I can build both a web application and a desktop application from the
same (presentation layer) source code - if no, what is the best way to
minimize duplicating code?

In the absolute sense, no. Some of the business logic may port relatively
well, but your presentation logic on the client (that deals with window
handles, wait loops, etc) has absolutely no correspondence at all to the web
(which deals with markup, sessions, etc.). If you can specifically target a
particular browser, you may be able to cleverly port some of your work as an
activeX control that gets loaded and executed in Internet Explorer, but
other than that, you're dealing with totally different worlds.

To answer your question regarding the best way to go about minimizing code
duplication, the only thing I can say is "I don't know, it depends". Without
seeing your application I can't really answer that question in any
meaningful way.
2). Which of the two languages (VB.Net or C#) will be better suited for
this job (i.e. coding a new presentation layer), and why ?

That's a matter of preference. A lot of people debate about which one is
more efficient, clean, productive, etc. and the practical reality is that it
all depends on the programmer and how they utilize the features of each
language.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~
Ben Rush
Microsoft .NET Consultant
http://www.ben-rush.net/blog
http://www.sideshowsystems.com
 
B

bruce barker

if your current app uses the MVC pattern then maybe.

the web is stateless, so so will be your business layer. you will need
to add a way to save and restore state. also all static variables must
be replaced with instance variables (as web requests are just separate
threads on the same application). if you use thread affinity variables,
then you must change to context affinity as asp.net will switch threads
during request processing.

if you current UI is very rich, then you are probably going to need to
write the UI in javascript and use ajax.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top