• 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

    • It’s encouraging that Intel is still competing, the best they can, in the gpu space.
    • Windows 11 KB5062233/ KB5060843/ KB5062197/ KB5061090 setup, recovery updates released by Sayan Sen This week Microsoft released non-security preview updates for Windows 11 22H2 and 23H2 under KB5060826 as well as for 24H2 under KB5060829. The company also published dynamic updates alongside them. Dynamic updates bring improvements to the Windows Recovery in the form of Windows Recovery Environment (WinRE) updates, also called Safe OS updates, as well as to the Setup binaries in the form of Setup updates. These Dynamic Update packages are meant to be applied to existing Windows images prior to their deployment. These packages include fixes to Setup.exe binaries, SafeOS updates for Windows Recovery Environment, and more. Dynamic Updates also help preserve Language Pack (LP) and Features on Demand (FODs) content during the upgrade process. VBScript, for example, is currently an FOD on Windows 11 24H2. Both setup and recovery updates were released. The changelogs are given below. First up we have the Setup updates: Up next, we have the recovery updates: Microsoft notes that the Recovery updates will be downloaded and installed automatically via the Windows Update channel. The Setup updates, however, need to be downloaded and installed manually. You can avail them on Microsoft's Update Catalog website: KB5062233, KB5060843, KB5062197, and KB5061090.
    • Gaming mouse review: Keychron Lemokey G2 8K Wireless, high performance, light in weight by Robbie Khan Available in the UK and USA, the G2 is a wireless gaming mouse by Lemokey, the customised gaming peripheral arm of Keychron, a brand many readers will know well. I've checked out Keychron keyboards recently, models such as the top-tier Q6 Max, and the bargain priced B6 Pro. I never got the chance to check out the G1, but the G2 seems to put itself firmly in-between competing 8K gaming mice out there whilst coming in at a decent sum under £100/$100. The other benefit is that it uses Keychron Launcher, the web-based software that has been a staple part of Keychron keyboards for a long time now. I rate the launcher highly and have rarely had a problem with it, so it is great to see a robust piece of software being used on an affordable gaming mouse that's not only built well, but performs well, too. As it's a high performance gaming mouse with a flagship PixArt sensor, I will be comparing the G2 directly against my personal mouse, the similarly sized Pulsar Feinmann F01. Both mice are priced wildly differently, so it was interesting to compared several factors between them to see if one bests the other where it matters most, or if it just comes down to individual preferences. Let's check out the specs... Keychron Lemokey G2 SKU G2-A1 Sensor PixArt 3950 IPS 750 MCU Realtek 8762G Connectivity Bluetooth 5.1 / 2.4 GHz / Wired (type-C cable) Polling Rate Up to 8000 Hz (2.4 GHz / wired mode), 125 Hz (Bluetooth mode) Motion Sync Yes Angle Snapping Yes Acceleration 50g Cable Detachable Type-C to C Cable + Type-A to Type-C adapter Dongle Micro USB-A dongle Main switches Huano Micro Switch Switch lifespan 80 Million Clicks Battery 300 mAh Battery life 60 Hours (Under 1000Hz) 35 Hours (1000-4000Hz) 20 Hours (4000-8000Hz) Skates Teflon / PTFE Lift Off Distance 0.7 / 1.0 / 2.0 mm Material (Body and Grip) ABS Dimensions 118mm / 62.6mm / 38.2mm Tracks on glass (min. 4 mm thickness) Yes (max 1000Hz report rate) Weight 52 ± 3 g Colours Black / White Price £73.99 / $69.99 Fit and finish Made of all ABS, it certainly doesn't feel anywhere near as nice as the F01, but then again it's priced much lower, so no complaints there. To me it feels more like a previous generation Endgame/Zowie mouse, before they started to use the more grippy textured finish. It's a fine finish but how long that lasts only time will tell. With the Endgame mice I always found that the side buttons would go shiny first, and I suspect the exact same to apply here with the G2, since the size and shape of them is similar, as is the material quality. Speaking of side buttons, my personal preference is flat and large buttons, the long and pointed ones like those on the G2 shown above and GAMIAC PX71 at the bottom always felt a bit awkward to me for naturally resting a thumb on, whereas the large surface area of the ones found on the Feinmann and others like it feel more ergonomic and comfortable for long usage sessions. Pulsar Feinmann F01 (ergo shape) Lemokey G2 (ambidextrous shape) Under my 19cm hand, the G2 feels comfortable and stable for both claw and palm grip styles, though my usual style is a hybrid approach. I like to pinch a mouse with a thumb and ring finger, then articulate forward or backward movement with them to adapt to different play-styles. Both mice have a sloping back hump that works brilliantly for this and i had no problem getting comfortable with the G2 here. The underside of the G2 hides a cool feature I wish more more mice makers adopted, can you spot what it is in the photo below? That little flap at the bottom to store the USB dongle, it's convenient, especially for gamers who travel with their mice or laptop gamers. The skates applied are PTFE and cover three zones on the underside, sadly I forgot to take a photo of them before swapping them out to my preferred skates, the Wallhack Pro UWMP yellow dots. I found no problem with glide resistance on the stock skates, though find dots glide nicer overall and these yellow dots slide around like butter. Lemokey states 52g for the weight, give or take 3g, so my scales measure up perfectly here. It's not as lightweight as the Feinmann which currently is 45g, but it's still considered super-light and honestly, under the hand, this weight difference on dot skates is hard to tell apart. Gripping the G2 hard on both sides shows no obvious issues with flexing, so the internal construction is also up to scratch and exactly what i would expect in this price range. The differences start to be noticed when you are using the G2 as a combination mouse, both in gaming and desktop use. The wheel is thinner than the one on the Feinmann and other gaming mice with fat wheels. I much prefer a nice wide wheel, the diameter is also much larger as can be seen with the overhead photo above. The button tops also have a distinct difference in feel when actuating the switches. there is more of a hollow feel to the G2's tops, as well as slightly more travel post-click. the Huano switches feel and sound excellent, though, but I think the ABS contact surface on the outside could have been slightly more distinct in feel. Here is a demo of how the main switches sound, you can also hear the switch tops clap if you pay attention: Likewise the side buttons have extra play after the switches actuate, something the Feinmann and others in the higher price category don't tend to have. Features & software Aside from the usual features that all gaming mice support these days, such as Motion Sync, lift off distance and Macro, the big feature with the G2 is that is uses Keychron Launcher, the web-browser based software. All changes are stored directly onto the on-board memory, here is what the sections within it look like: I found no bugs with the implementation here, and unlike other Keychron wireless devices I have used with Launcher in the past, the G2 connects and can be customised in it over both wired and wireless. Just be aware that the firmware update option when connected via wireless will only check the dongle's firmware. To check the G2's firmware, a USB cable will need to be connected. Performance Whether on the desktop in Windows or in games, the cursor and motion performance is excellent, though this is to be expected from all modern gaming mice, regardless of price. The higher priced mice tend to have better use of high quality materials, and implementation of software and physical features. I'm currently pacing through nine games, all mixed genre, and in each of them I had no troubles quickly getting comfortable with the G2. If you're used to an Endgame XM2we sized mouse, then this will be just as familiar to you. The convenience of the DPI button at the top of the mouse instead of underside makes instant switching simpler, although the button can be remapped to do something else for those who don't care about DPI toggling. Here is a demo of the G2 playing Doom: The Dark Ages: The sensor tracking performance at 8K was perfect, aside from the few moments my physical movement on the mousepad slowed down causing some drops in the Razer mouse tracking measurement graph below: A consistent 7900-8000Hz polling was observed, though keep in mind that using such high polling rates will impact CPU performance whilst gaming. How much this affects framerates will boil down to the CPU you have. On my i7 12700KF there was no change whilst gaming, but during the measurement above I did observe 13% CPU package utilisation. In practice, though, I saw no performance difference playing at 8K versus 2K or even 1K. Battery life will drastically be impacted at 8K polling rates for obvious reasons, and whilst many prefer 4K, there is a growing trend to just stick to 2K which feels the safe middle ground of great battery performance, whilst still being suitably responsive on paper for even the most fast-paced of gaming sessions. Conclusion The Lemokey G2 has proven to be a rather excellent mouse, not just for gaming, but general use, too. Though being excellent doesn't give it any special status, as there are equally excellent mice out there that cost the same, less and even more. A buying decision will come down to individual needs, do you value the use of a browser-based software tool like Keychron Launcher? If so, then this is right up your street. Do you want something lightweight but also supports the gaming features and feel in the hand as more expensive mice? Maybe the G2 will satisfy. It's not totally perfect, nothing ever is, the thumb buttons could have been a bit wider, and the switch caps have more travel after clicking than what I am comfortable with, but otherwise this is a great mouse with features that rival the competition. The sensors on gaming mice these days isn't a key selling factor any more either, since even entry level gaming mice are capable of precision tracking and speed that was only possible on the top-tier models of the past, like many things in tech now, the point of diminishing returns has been reached, and brands have to work harder at giving us consumers a unique selling point to attract interest. I believe the G2 has at least one USP (Keychron Launcher), it also helps that it's a very comfortable mouse to use for all-day sessions.
    • Delays can happen any time and names changed, but the joke was still there to be made.
  • Recent Achievements

    • Week One Done
      Alexander 001 earned a badge
      Week One Done
    • Week One Done
      icecreamconesleeves earned a badge
      Week One Done
    • One Year In
      PAC0 earned a badge
      One Year In
    • One Month Later
      PAC0 earned a badge
      One Month Later
    • One Year In
      Shahmir Shoaib earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      564
    2. 2
      +FloatingFatMan
      187
    3. 3
      ATLien_0
      185
    4. 4
      Skyfrog
      113
    5. 5
      Xenon
      109
  • Tell a friend

    Love Neowin? Tell a friend!