I am currently working on a project for my employer to update the existing warehouse management system from a desktop application to a web application. After some thorough research, I had concluded to use ASP.NET for its familiarity and use of the .NET framework. The existing program is written in C#. I am currently programming the update in ASP.NET with C#. My question is is it possible to just use the existing written C# code in the update, keeping same functionality? I understand their may be some rewriting of syntax to fit with current standards. Any information would be most helpful.
-
Yes/no. If the existing project is high quality code you can leave the domain and data layer untouched and just rewrite the view layer and io layer to use a browser and http respectively. If the existing project is mediocre rewrite it entirely. Sidenote: avoid asp.net webforms and use asp.net mvcRaynos– Raynos2011-12-05 03:37:40 +00:00Commented Dec 5, 2011 at 3:37
-
As pointed out below, it is quite possible. You may find that the existing code doesn't really handle running as a library however. It all depends upon the original application's design.Will Bickford– Will Bickford2011-12-05 03:40:04 +00:00Commented Dec 5, 2011 at 3:40
-
So for a program such as this what do you guys recommend, forms or MVC?FantomVII– FantomVII2011-12-05 14:55:37 +00:00Commented Dec 5, 2011 at 14:55
4 Answers
Most certainly, you should be able to leverage some, most or all of the functionality. But very likely, you'll have to restructure the code so that it can be used as a library. More importantly, you can't really do this restructuring (refactoring) without some "safety-net" -- unit tests serve that purpose.
But yes, it can be done.
Comments
Yes it might be possible, but it really depends on how its written, it's quite possible that the web style lifecycle won't suit the current design.
Fundamentally though, existing C# code can be used. If you have the source, then just package it up into a library. If it's really intermixed with windows code, then its going to be a bit more painful, eg, if it pops up message boxes etc.