• 0

Migrating winforms app to a web app - any advice ?


Question

Dear neowinians,

 

I wonder if you have any advice - suggestions if any of you went through something similar.

A bit of context : here at work we're developing and maintaining an old VB.Net winforms custom application for our client - I say old because it already had about 10 years before I joined here, and although we're not a big company, many many people have worked on it; you can imagine the kind of app, it's big, it's complicated, it does many things, and many of those things are done in many different ways, and nobody never had the time to update/upgrade our coding standards on an application-wide scope. By that I mean, e.g. if you think in terms of MVC architecture, in some places, some of our M's and V's are mixed together and that is bad for a number of reasons that we won't get into right now but may be important for the rest of my tale...

Anyway so one of our big problems right now is that everyone at our clients' use this software, and by everyone I mean that they have people in a few different countries, and they all have to connect to a central database with all their common data, and obviously there's so much I/O between the database and the app that this is starting to become a problem. Long story short, on of the possible solutions my boss is considering is making a web app. This would force us to put all the logic in our controllers, as it should be, and all the communication with the database would be server-side.

I assume we would have to rewrite all (or most) of our UI (because, duh). My boss, however, hopes we would be able, if we used Microsoft tools (I'm guessing that means ASP.Net), to keep some of our objects and code intact. As I said, there's a number of places where that's not the case, but some places where it is, it's hard to pinpoint them without analysing the entire code, which we'll get to eventually. He also hopes that, maybe, we would be able to have both the desktop and the web client, side by side, sharing some of their objects - I believe this would require considerably more work than the already big task we'd have ahead of us, but whatever.

 

Soooooo, my question : if any of you have faced a similar situation or have a familiarity with these technologies, would you have any advice, things to avoid, things to watch out for, what dangers we would face, what could go wrong (plenty of things, but, you know)... I'd be glad to hear your stories. If not, well... thanks for reading anyway ! Have a nice day and whatever !

18 answers to this question

Recommended Posts

  • 0

Why not make a web api in asp that the forms gui can contact?

 

And please don't put all the logic in the controller, use something like a repository pattern that keep the logic and data code apart and outside the controller. The controller should only need to contact the repository.

 

Personally I'm a fan of APIs since it's easy to use those when making apps and other websites.

 

Is it possible to post some more details of the current code like a class diagram?

 

In college we had to make apps in winforms and convert them to asp all the time, which wasn't an issue since we learned how to actually keep the gui, logic and data code seperated so we only had to rewrite the gui.

 

 

P.S

Create paragraphs in long text posts, it's easier and clearer to read for others that way.

  • Like 3
  • 0

sorry about the paragraphs thing, I was in a rush and did not realise how crappy my text looked

 

I must have skipped a class in CS, my understanding was that controller was supposed to contain all the logic. I'll refresh my knowledge of the repository pattern asap (as it stands I dont remember which pattern that is but google will fix that I guess).

 

also the api thing is interesting, thanks a lot for the suggestions already !

  • 0

brpsycho,

 

In my last company, we had a (very) large winforms app that needed a client facing web version created. We did this by first creating a full API and better architected WCF service operations. We then created the Web UI (in java) to consume the web services. We then over time migrated the winforms code to do the same. In the end we landed up with a rather thin desktop UI and a robust web ui that both utilized the same core code.  Maintenance went way down as did defect density.   

  • 0
  On 27/01/2017 at 12:28, Zag L. said:

brpsycho,

 

In my last company, we had a (very) large winforms app that needed a client facing web version created. We did this by first creating a full API and better architected WCF service operations. We then created the Web UI (in java) to consume the web services. We then over time migrated the winforms code to do the same. In the end we landed up with a rather thin desktop UI and a robust web ui that both utilized the same core code.  Maintenance went way down as did defect density.   

Expand  

Why java?!

It's 2017... java applets for the web have horrible support and aren't supported on mobile devices. At least if you're going to do it right consider making it work on all devices.

 

If you choose the api route you can just use html with js(ajax/socket), this can be made from scratch or by using a web framework.

 

If you choose the non api route you can just make it a mvc application in asp, depending on the existing code it's a matter of creating controllers and views.

 

The least work is a simple asp website, though if you want to create other services that contact the database it's recommended to make an api instead.

 

Anyhow any class diagrams(redacted is fine) of the existing code would have a clearer view of the current situation and the available options.

  • 0
  On 27/01/2017 at 13:58, Seahorsepip said:

Why java?!

It's 2017... java applets for the web have horrible support and aren't supported on mobile devices. At least if you're going to do it right consider making it work on all devices.

 

If you choose the api route you can just use html with js(ajax/socket), this can be made from scratch or by using a web framework.

 

If you choose the non api route you can just make it a mvc application in asp, depending on the existing code it's a matter of creating controllers and views.

 

The least work is a simple asp website, though if you want to create other services that contact the database it's recommended to make an api instead.

 

Anyhow any class diagrams(redacted is fine) of the existing code would have a clearer view of the current situation and the available options.

Expand  

Why are you assuming it's an applet and not jsp? Honest question. Did I miss something? 

  • 0
  On 27/01/2017 at 14:04, adrynalyne said:

Why are you assuming it's an applet and not jsp? Honest question. Did I miss something? 

Expand  

Direct quote: "Web UI (in java) "

 

If it was jsp the webui would still be html.

  • 0
  On 27/01/2017 at 14:14, Seahorsepip said:

Direct quote: "Web UI (in java) "

 

If it was jsp the webui would still be html.

Expand  

I suppose... I figured it would be something akin to razor which generates the HTML. Perhaps not. Thanks. 

  • 0
  On 27/01/2017 at 14:40, adrynalyne said:

I suppose... I figured it would be something akin to razor which generates the HTML. Perhaps not. Thanks. 

Expand  

Yeah that could also be the case but in that case you still talk about a html gui even if the html is generated in jsp, asp, php, whateverp.

 

And since he mentioned "robust web ui" which I often heard in the past as argument for java applets of flash based applications... This is one of the ridiculous reasons why watching tv online in most cases is still only working on Silverlight in some old version of IE.

  • 0
  On 27/01/2017 at 14:50, Seahorsepip said:

Yeah that could also be the case but in that case you still talk about a html gui even if the html is generated in jsp, asp, php, whateverp.

 

And since he mentioned "robust web ui" which I often heard in the past as argument for java applets of flash based applications... This is one of the ridiculous reasons why watching tv online in most cases is still only working on Silverlight in some old version of IE.

Expand  

I suppose. I've found that people who don't really do the development don't know that it's generating HTML and talk about it as if it's still in it's raw state as c# or whatever. You are probably right though. 

 

You would not believe the crap I've run across like that. My favorite is developers who use obsolete code (that is tagged as such) which then gets removed in some future release.  Years later, you take over the support and maintenance from another company, update the frameworks and the codepocalype begins...

 

Ive run into that too many times and then I get to spend my time hunting down the problem. 

  • Like 1
  • 0
  On 27/01/2017 at 13:58, Seahorsepip said:

Why java?!

It's 2017... java applets for the web have horrible support and aren't supported on mobile devices. At least if you're going to do it right consider making it work on all devices.

 

If you choose the api route you can just use html with js(ajax/socket), this can be made from scratch or by using a web framework.

 

If you choose the non api route you can just make it a mvc application in asp, depending on the existing code it's a matter of creating controllers and views.

 

The least work is a simple asp website, though if you want to create other services that contact the database it's recommended to make an api instead.

 

Anyhow any class diagrams(redacted is fine) of the existing code would have a clearer view of the current situation and the available options.

Expand  

Why java? Good question. The company mandates that all public facing web portals must be java web applications running in IBM WebSphere jvm's serving data via apache servers . According to the wizards in infrastructure, there is no way to secure IIS or any MIcrosoft product.  Anything outside the firewall cannot in any way, shape or form be Microsoft anything. Not saying I agree with any of their rules, just telling ya what it is.

 

We did get a pretty big chuckle when they were all scrambling over that OpenSSL 'issue' a year or two back though...

  • 0
  On 10/02/2017 at 18:48, Zag L. said:

there is no way to secure IIS or any MIcrosoft product

Expand  

Just wow!  They could do with a little education in their chosen field.

  • Like 3
  • 0

ASP.Net is your friend.

 

  Quote

Anything outside the firewall cannot in any way, shape or form be Microsoft anything

Expand  

Tell that to the millions of edge Windows Servers hell up until a few years ago they had their own firewall/gateway.

  • 0

Going to agree with TPreson on this...

WinForms to WebForms is probably the easiest migration you can do... ASP.net Webforms is relatively easy to develop and they can be done in both VB.net or C#.net

 

I am not a big fan of MVC style pages for traditional data heavy enterprise systems, because it takes much more effort to build complex data forms.

WebForms has rich controls and control extenders which make implementing a new version of a legacy app very quick and easy.

 

Ask any MVC programmer to build a editable gridview app and ask a webforms person to do it.  It takes 10x the effort in MVC than for Asp.net webforms.

  • 0

Thanks to all of you for all the advice.

 

At the moment our priorities seem to have changed (they do that very often.......) but the web app still somewhere down the line.

I'll look up ASP when I get the time, it seems like an "easy way out" (or a "not that hard" way out ?).

Seems to me with the current state of our software, we'd have to do a lot of work whichever solution we chose, re-architecturing some things, rethinking some others... But it would be for the better, if my boss manages to sell that to our client.

  • 0
  On 14/02/2017 at 01:48, tekgik84 said:

have you thought about what kind of perimeter security to deploy?

Expand  

No. I have like, zero knowledge of security (yes I know this is scary). (ok in truth i know just enough to know I know nothing).

 

My boss is supposed to be the "know" guy. All I know about our current project is this : I think he wants to deploy this as an "intranet" thing that they would access through a VPN - they already work through a VPN and remote desktops right now - but we're going to hit problems as the client now has a subsidiary in China where VPN might not be an option, so I don't know how that's going to change.

I never really thought about security because he just casually asked me to look into a way to "port" some of our current app into a web app, and find out how much work we could keep. Now that I think of it, this might be a pretty big deal.

  • 0
  On 05/12/2017 at 14:35, AltexLansing said:

Wisej seems to be the easiest way to turn a winforms app into a modern web app. 

Expand  

Hey, thanks, that's an interesting find. I'll give it a look some time.

 

The client chose to put aside that project for now and keep the old winforms app and we're still maintaining it instead, but I'm still interested in stuff like that.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Denmark ditching Windows and Office for Linux as it may not want to rely on Microsoft, Trump by Sayan Sen Back in November 2021, the German state of Schleswig-Holstein announced that it was planning to move away from closed-source Microsoft products like Office and Windows to LibreOffice. About two and a half years later, we received an update on the matter, as state officials confirmed that plans for the migration were still intact. As such, about 30,000 government sector computers would be switching by 2027 or so. Following Germany, Denmark seems to be looking to make such a move. This move should resonate pretty loudly now, given that Linux developers, including The Document Foundation, are pushing to encourage users to pick GNU instead of upgrading to Windows 11 from Windows 10. Caroline Stage Olsen, the current Minister for Digital Affairs of Denmark, told the Danish media outlet Politiken that there are plans to phase out Microsoft products in her own ministry next month, and more precisely, moving away from Office 365 to LibreOffice. When discussing the potential challenges of implementing such deployments, Olsen shared a clear backup plan that her ministry has: if the new system proves too challenging at first, they will temporarily revert to the previous setup while they explore other solutions, and overall she is pretty firm on her decision as she stated, "We won't get any closer to our goal if we don't start." The report adds that, thus far, the response from her team has been positive. The minister also added that this initiative isn’t solely about Microsoft. Instead, it’s a step toward reducing an over-reliance on just a handful of providers. The report mentions that the decision could be related to recent events surrounding the International Criminal Court (ICC). For context, the ICC's chief prosecutor, Karim Khan, lost access to his Microsoft Account following Trump's sanctions (via Associated Press). There is also the issue of Trump's keen interest in Greenland, which happens to be a semi-autonomous region of Denmark.
    • Arlo Essential 2K Indoor Camera: Unpacking the features and value of this home security cam by Paul Hill Are you in the UK and looking for internal cameras to keep an eye on your pets or property? If so, the Arlo Essential 2K indoor security camera (2-pack) is now discounted by 26% from its £159.99 RRP to just £119.00. As usual, the product is available with free delivery and free returns, which is helpful if the product turns out to be defective. In addition to the discounted product, the listing also notes there’s a £10-off voucher available until Monday and a £10 Morrisons on Amazon voucher. Arlo is a reputable brand for home security cameras so this deal marks a great opportunity if you’ve been looking for this type of device. Do note that it is a wired camera so it’ll have to be plugged in somewhere. Deep dive into camera features and capabilities The Arlo Essential 2K indoor security camera comes with a very good 2K (up to 2,560x1,440) resolution that provides you with clear, detailed video, great if you want to keep an eye on smaller pets such as kittens. Not only is the camera high-quality, but the camera is equipped with black and white night vision (it can see up to 7 metres), so you can see any events that occur at night. This Arlo security cam features two-way audio with noise reduction and echo cancellation allowing you to chat with anyone coming to feed your pets. There’s also an automatic privacy lens cover that physically blocks the lens when disarmed, providing you with more privacy when at home. There is also passive infrared motion detection that has a range of 7 metres. You can use motion detection in combination with the 80 dB smart siren to scare away intruders. The siren can also be activated manually. The Arlo Essential 2K features a 130-degree wide-angle diagonal view, which is sufficient for most rooms, to capture more of what’s going on in the room and there is 12x digital zoom to take a closer look at objects. It’s compatible with pretty much all Wi-Fi devices with its 2.4GHz Wi-Fi support and it integrates with your smart home via Amazon Alexa, Google Assistant, and IFTTT. Leveraging the Arlo Secure subscription for enhanced security When you buy the Arlo Essential 2K, you get a 30-day free trial of the Arlo Secure subscription, and if you want to continue it, it costs from £11.99 per month or £119.90 per year. This subscription isn’t necessary for basic functionality, but it does unlock the full potential of the camera. When you subscribe you get secure cloud storage for video history (30 to 60 days depending on plan); AI-powered identification of people, animals, vehicles, and packages, reducing false alerts; custom activity zones that let you define areas for motion detection, minimising unwanted notifications; and interactive notifications that can be interacted with from the lock screen like view animated previews, activate siren, and call emergency services. My biggest issue with this camera is that there is no local storage for recordings, necessitating the need to buy the subscription if you want to save any footage. If you’re thinking of using this camera to protect your home from theft and want footage to give to the police, you’ll need a subscription. An alternative to a subscription is buying the Arlo SmartHub (VMB5000) which is compatible with the Arlo Essential 2K indoor camera, according to Arlo’s website. The savings on this camera twin-pack are significant and it’s the lowest price they’ve been at on Amazon UK so they’re definitely worth considering for your home. If you don’t mind the subscription or have the Arlo SmartHub already, then this camera makes sense. If not, then you may be better off with a camera that comes with an SD card slot and recording capabilities. Arlo Essential 2K Indoor Pet Security Camera (2-pack): £119 + £10-off voucher + £10 for Morrisons on Amazon (Amazon UK) / MSRP £159.99 This Amazon deal is U.K. specific, and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon UK deals page here. Get Prime, Prime Video, Music Unlimited, Audible or Kindle Unlimited, free for the first 30 days As an Amazon Associate we earn from qualifying purchases.
    • The Nokia Lumias? Or the third-party HTC One8's? I had HTC's hardware cuz it was slick and reliable... but, yeah, the software left me wanting more and I just couldn't allocate personal time to develop all of the software I would have wanted to see (overworked in other capacities @ MSFT at the time, heh).
    • Microsoft's mobile strategy had great future vision and UX research, but mediocre engineering and inadequate support (third-party and internal business alike). The death knell for WinMo was Google's (mostly YouTube's) incessant API blocking and purposeful release of buggy WinMo builds to force consumers to stay away -- and this was conducted via sabotage of whatever partnerships they were supposed to play nice in. I still yearn for that UI on a modern smartphone...
    • Linux has always been an option but never adopted by the masses despite being free. The reasons are limited usability and features. Despite everything we all complaint about with MS , the overall experience for the general public is much better than what Linux can deliver.
  • Recent Achievements

    • Week One Done
      evershinefacilityservice earned a badge
      Week One Done
    • One Month Later
      evershinefacilityservice earned a badge
      One Month Later
    • One Month Later
      POR2GAL4EVER earned a badge
      One Month Later
    • One Year In
      Orpheus13 earned a badge
      One Year In
    • One Month Later
      Orpheus13 earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      563
    2. 2
      ATLien_0
      256
    3. 3
      +Edouard
      163
    4. 4
      +FloatingFatMan
      157
    5. 5
      Michael Scrip
      109
  • Tell a friend

    Love Neowin? Tell a friend!