How to migrate winform application to web apsx - asp.net

everyone, maybe on many occasions you have come across someone who has many winforms applications developed in visual studio. Well, in my case, I have a fairly complete system made in a winforms environment and I need to transfer it to the web since a client changed his entire team to use mac. Someone has a recommendation because I would not like to have to start from scratch to reprogram everything. I also did not bother the customer by asking him to install virtual machines.
In advance, thanks for any suggestions

Converting Winforms to ASPX aka Webforms? Probably not a good idea: Webforms is discontinued. I would prefer Blazor, that is built on ASP.net Core. With outstanding interface performances.

You don't have much of a choice.
this really comes down to two systems having VAST different architectures.
Even on the desktop? You can no more convert a complex FoxPro application to vb.net. Or convert a ms-access system to FoxPro. They all would have been built from the ground up with 100's, if not 1000's of little design choices based on the given tool set.
This is kind of like the difference between a car, and say a airplane. They are both machines for transportation. But even things like the seats. One (the car) might have big comfortable seats - power assisted tilt etc. The goal is comfort, and total over all space and weight of that seat is not all that huge of a design goal.
Now, take the design for a seat in the airplane. It has to be lighter, thinner, probably use more fireproof materials. So 100's if not 1000's of SMALL design choices along the way will result in a seat for that car, or the plane.
It just a seat, right? So, since the architecture between the desktop and the web is much like the difference between a car and a helicopter? then little of the 100's if not 1000's of design criteria you used to create that desktop application simply will not apply, and thus the work can't be salvaged.
However, if you had used WPF in place of win forms for the desktop application? Then you can salvage a LOT more, since both the web application and the desktop application will have "mark-up" used to create the form/display in question.
In fact, this is one reason developers will choose WPF over winforms. (it allows easier migration to the web). And for those coming from web development? They will find WPF forms and layout VERY similar to how they do web development.
And the other reason of course is now with css, HTML5 and a whole bunch of other new things for the web? Well, then web developers actually have MORE UI choices then the desktop now!. So, WFP is an attempt to leverage many/much of the web based new technologies into desktop development. So while winforms don't support a graphics in a button? WPF does support this - so does the web.
But, ask any WPF developer? The cost + time for WPF desktop applications is a LOT more work. And so is creating web based. Some claim they can develop just as fast with WPF applications for the desktop - that's not what I seen - and NOT even close!! You find for the web, as much as 2 times, and often 3-5 times the cost compared to desktop.
Now to take a huge application and re-write because of a few Mac's? Well, that is crazy. You would setup terminal services, and have those Mac use remote desktop to run that application. Thus, the Mac's don't need VM's or anything.
But, there is no automated conversion system, and like parts, sets and doors from a car? They don't work nor fit on a helicopter. Too much difference of a architecture is at play here.
I guess this would depend on the size, scope and estimated cost of the existing application. But to allow workers at home (remote), people on the road, and that of allowing Macs to use that software? I don't see why terminal services is not a solution - and that can be setup in less then 1 day as opposed to a whole re-write of the given application (to run on a few Macs? - doubt that can justify a re-write).

If you're asking how to take the code you wrote over the years to create Winform-based, rich user experiences and adapt it for the web, then you will be disappointed.
The best you can hope for is to have such a clean separation of concerns in your existing app that it would allow you to salvage all code that's not UI dependent and use it in the backend of a whole new application. Everything else will have to be rewritten from scratch.
If your client still wants to use your Winform-based app in a Mac environment, he'll have to use a VM.

Related

Enterprise Framework - UWP Vs. Web

Broad, sweeping question here...
Assume you have built an enterprise level framework with some rich client in the .Net (Microsoft) sphere, with a WCF back end. Now, imagine that that enterprise framework's UI technology is being deprecated in favour of UWP.
The choices for a front end replacement basically are: UWP, Web (HTML), or some other rich client technology.
How would you go about the decision making process?
I personally lean toward a rich client where the user base is a captive user base. I mean, where the users' IT department is happy to install the necessary runtime environment on the machines, etc. This is usually not a problem with Microsoft technologies, and this won't be a problem in about 10 years when organizations roll out Windows 10.
But, people are telling me these days that web has come a long way. People are telling me that JavaScript frameworks are becoming very sophisticated, and that low level JavaScript for basic data binding and the like is mostly unnecessary.
I have really been turned off by web solutions like ASP in the past, but I do understand that technology has moved forward, and I do understand that Microsoft have been working on ASP.Net v Next which might actually be good?
The question is not so much what would you opt for? But, what factors would you take in to account to decide which platform to go for?
Opnion based answer here...
In a decision to adopt a particular tech for any project lies in many factors. I can cite two majors for your particular scenario.
1 - Client adoption. It's easy for the customers to use/install it? They need to pay some sort of license? Can it run in all platforms/devices the customer already own?
2 - Market adoption. It's easy for you co-workers to adopt it? It's hard to find/hire experienced/hardened developers? We need to pay some kind of license? Can I trust it ill be a long lived technology?
The answer to your question can be HTML.
Not only it is already got a lot of momentum in market, it ill take years to change it even if today someone (big like MS or Google) put some new (better) stuff on the table.
Also if someone on MS marketing dep say next week Universal Windows Platform or WinRT must die it ill die (like Silverlight). So Im not adopting some new technology just because some big player told me to do it.
Yes web has come a long way indeed. You can do a lot of amazing things just with JS+HTML+CSS those days. Also the right usage/architecture of it ill allow you to put your app running in PCs, Tablets and Mobiles (at a minimum cost to port between devices) and capable in running in anything can access internet.
I suggest you to catch up and learn a lot about webservices, Json, JS libraries like JQuery, Sammy and some nice stuff like Knockout, SPA, Angular, Node, etc.
Edit, answer to comments
To not start a chatty comment I'll respond here. Yes your questions and comments brings interesting questions. To let it readable for posterity both of us can edit answer and question to organize it.
Silverlight. How not love it? In special after strugling with flash. It's a shame MS pulled the plug (die in hell MS CEOs). When MS let it to die I was planning a big web app SL was my first choice. Why I changed my mind? Well 2 years to develop that app and at the end how much browser ill get along supporting it? The SL community is great, the tool is great but browsers can just say, Hey tomorrow there's no guarantee it keep working.
.Net and MS platforms. I'm a .Net developer. I adopted it since beta, first to work with winforms (in a previous life I was a proud Delphi developer). After a while started to work with web. I also worked in classical ASP (bad times) and loved .Net ASP from start.
You can run .Net apps in almost any PC in the planet today. Not exactly true for all mobiles/gadgets. For browsers pure HTML+JS+CSS ill to better because it's lightweight (done right). Also we can move a lot of thing to client side and just let it hit the server only when necessary. .Net apps can do that, sure, but ill never be light as a tailored HTML+JS+CSS.
In fact I believe you can do anything with .Net and you can do amazing things if you got a few good developers in your team. But depending on the project it ill do better (and cheaper) in HTML or PHP or Ruby or Java, etc.
In fact at a previous shop, with both PHP and .Net teams we found (after 1 year study, metrics, lots of projects) small projects are better done in PHP, larger ones in .Net (if I remember a medium project can be 4k to 6k men/hours).
The point here is. You really must read a lot about HTML, CSS, JS, SPA, Angular, etc. Bringing to live a big and shinning web app is challenging today not because what we can do (we can do anything) but how we can do. DDD, MVC, MVVM. Testing framework, etc. Man Node is the future (the concept at least).
Web developing really changed in the last years and with it the clients and users expectations. Today no one ill wait for more than 2 secs for a page to load. Everybody wants usability to be at the top of the table from project scratch. You app must be responsive, etc. (not using Dilbertian management buzz words here for the sake of it. Just stating usability is that important today).
And don't forget everyone wants it to be beatifull (from a graphical designer point of view) even if it's a dull B2B supposed to be used only by cave mens.
Even if you stick to a classical .Net app learn about the (many) options, that can bring a new wider perspective.
I have decided to answer this question here because we've had a lot more time to investigate and look at different options. The original question turned out to be a bit of a furphy. Pure UWP and Web are not the only options. There is also a Xamarin Forms as an option which includes UWP, Android, and iOS. As a personal preference, I am leaning toward using Xamarin Forms as a client instead of any other development platform because it supports three OSs out of the box: Windows 10, iOS, and Android.
I believe the answer to the question is: you should only develop a web app if you need to. Does your user base consist of people who will mostly prefer a browser over apps? Are your potential users likely to want to avoid downloading an app? Is your app very simple, and you want people to be able to dive in very quickly? Are you able to get away without access to things like the camera, location and push notifications? If you can answer yes to these things, then I think you should go for HTML 5/JavaScript. If however, your user base is comfortable downloading apps, and you think that your app will require a UI more sophisticated than most browser apps, I'd recommend looking at Xamarin Forms as the preferred option. We've had very good success with Xamarin Forms so far, and the UWP version of our Xamarin Forms app has turned out just as good as our first stab at a UWP app.
Note: I should give Web Assembly (http://webassembly.org/) an honorable mention here. This technology is being considered in all the big tech organisations like Microsoft, Apple, and Google. One day, it may make deployment of native apps in a browser great again.

Development Effort: Web vs. App

what does the relation between a Web frontend and a smartphone App with identical feature sets look like regarding the development effort? Are there any specific differences regarding the development effort between Apps of different smartphone platforms (iOS, symbian OS, Android, etc.) ignoring training time? A general estimation would completely satisfy me. ;)
Thanks in advance,
Flinsch.
I hesitate to call this an estimate, or even an informed guess, but perhaps by putting down some ideas I might help your thinking.
Ignoring any particular platform specifics I see the fundamental difference of Web v Native is that in the Web case you have some extra work to do:
a). You have presentation separated from the backend, with probably HTTP in between. So there are services to write and issues concerned with notifications and/or polling to deal with.
b). You're likely using a browser to do the presentation so you will be using some JavaScript kind of library, and these are still hard to drive.
So, if you are targeting a single device my guess is that writing native code is likely to be 50% quicker than web-based code - assuming that you really are targetting identical function.
What seems to happend is that we compromise Web Apps, reducing functionality somewhat and hence the overhead is reduced.
Also there's another factor, the UI portions of the Web App are in principle portable, hence in fact the Web App development may be a reasonable investment even if it does take more effort.
I suspect that portability may well end up being a dominant consideration.
specific differences? There are plenty, but each with their own tradeoff:
UI: Web applications have CSS, (HTML, XHTML, HTML5) specifications that is supported by major browsers (although have have their issues). For Smartphone apps, each UI has to be designed and implemented according to the language the apps can be built on. You can effectively create apps like Winamp (having skins). For web applications, this is relatively a quick effort compared to writing UI's for each different smartphone OS models out there.
Language of use/Portability: In Web applications, an application sits in a server, so every request is sent to the server and response is returned from it. This allows that 1) Web applications can be written in any language of choice, as the end user never sees the server nor needs to configure it, 2) It allows the developer to write in a language that he/she is comfortable in. In smartphone apps, for the developer to run his apps to all the smartphone OS'es, he/she has to learn the programming language for the OS, and learn to port their code to work there (if porting is possible). That never exists in Web applications.
Hardware limitations: For smartapps, the developer must be aware of the cellphone capabilities and limitations. Facebook (e.g.) can essentially grow their memory, and add new servers and cluster their environment as the demand grows. You can't do that with smartphone apps. You will have to limit your implementation to run in a capability that your desired smartphone can accommodate.
There are more (feel free to add) but all these are part of the development effort that a software developer has to look at if they want to go a a field of choice.

Tools and techniques for productive web based development

I work in a company which is primarily concerned with desktop apps not served over the internet.
Part of my value is I have a web based background and proficiencies in ASP.NET, JavaScript, JQuery etc.
The issue I'm having is that compared to a traditional desktop application building a rich web based app is more time consuming. This is understandable in terms of the hoops that need to be jumped through for web development. This is a cause of frustration for those not familiar with the ways of the web.
However because people are used to the non web world where I work I need to utilise every possible tool and technique to be productive as possible while building web based applications.
As such I'm looking for what other people do to be as productive as possible while making web based applications. I'm primarily thinking of ASP.NET (not using MVC) but apart from that everything is open.
The best tools for web development, in my opinion, are:
.Net Reflector
Firebug
IE Developer Toolbar
IE Tester and MyDebugBar
Fiddler
You should also look into NHibernate as an option.
The best choice of tools tends to vary quite a bit from one developer to another. It's also very dependent on the details of the type of application you're building.
For me, Visual Studio Team Suite is indispensable. It has a rich set of visual designers and other features that have a big impact on my productivity. Deep integration with bug reporting and source control is another huge time saver (I use Team Foundation Server).
With web forms, you can of course often use drag-and-drop components, which improves productivity for some people (although not me). I can't say I'm a fan of most third-party components. They can be quirky, take a long time to learn well, and then still not do exactly what I want them to. It's also a skill that often isn't portable from one job to the next.
You can leverage jQuery to help simplify scripting -- although even with jQuery I find scripting to be one of the most time-consuming and error prone aspects of web development.
If it's suitable for your environment, you might explore Silverlight. That way, you can often have the best of both worlds, building desktop-like apps using desktop-like tools, but with web-based deployment (Expression Blend is an awesome tool). You can also use Silverlight as a replacement for JavaScript in many cases, with code that's compiled and type-safe.
Good tools on the data side are critical, such as SQL Server Profiler. Visual Studio Team Data (part of Team Suite) is invaluable for it's data generation, unit testing and deployment and management aspects.
Something very underrated by many web developers is building up an appropriate infrastructure: things like logging and performance counters, that can help you track down problems quickly when they occur. A solid configuration system is also important.
In case it helps, I put together a longer list of tools. I also write about something I call the "ultra-fast approach" in my book, which is about more than just building web sites that run fast; it's also about how to build them quickly and reliably: Ultra-Fast ASP.NET.
You should use third party tools.
Telerik RAD Controls and the AJAXToolkit are two such tools available to you. They make much of the 'fancy' stuff built in.
Then, and probably preferably, use JQuery.
With those three options, you can make a fancy web application in the quickest way possible.
Finally be sure your UI and business logic is properly segregated so you can reuse your business logic easier.
There are several ways to increase productivity while building web applications, and they're not too different from desktop programming.
Code re-use. As a shop that is primarily desktop-based, this may not be an immediate option. But as you build your code-base, you'll find that you can use some of the code over for new applications, and even begin building your own customized frameworks.
Development tool knowledge. If a lot of the tools are similar, then you may see immediate benefit from this. If not, it may take more time as the team gets used to new IDEs, etc.
Third-party tools. UI toolkits, backend frameworks. These exist in both worlds, and could be utilized to help jump start development, until items 1 and 2 can be worked in.
A few must-have tools on the client side (i.e. the browser)
FireBug - let's you debug your javascript, DOM, headers, etc
WebDeveloper - provides all sorts of information about the rendering of the page
Selenium - Web UI functional testing framework + tool
(all are firefox add-ons)
Here's some of the tools I use for IE and FireFox, http://www.learn-ajax.com/blog/2008/04/debugging-tools-for-web-applications_03.aspx . Chrome, Opera and Safari also have their own built in client-side web development tools as well.
Most important tools for ANY productive development
Dual large screen monitors
keyboard and mouse that works for YOU.
Comfortable high-backed chair that will save you taking 2 weeks off for physiotherapy down the road.

Building Enterprise level Line of Business application in silverlight Pros and Cons

Currently i am working on developing one Warehouse solution from scratch, i am planning to build it in silverlight (as this solution will take around 8-10 months) and the programming will start from Feb 2010.
I need to develop this application for one organization. Certain parts needs to be accessed by public which we are planning to build in ASP .Net 3.5
Now i just wanted to start a thread here for pros and cons of using silverlight, some of them i have already analyzed
Pros :
Rich UI
Excellent user experience
Reduction of scalability concerns
New set of features like data binding, control template etc..
Speed of development (After initial learning curve..my experience says it is faster to develop it in silverlight)
Other rich set of features coming up with SL 4.0 (SL 4.0)
Cons :
Cross platform issues (moonlight is there but it may take some time)
Cross browser issues (Chrome or other browsers)
Learning curve
Any other unknown risk (As there are not many enterprise level application developed in silverlight...or may be i am not aware)
I have also got one link for Pros and cons of silverlight(here) some of the cons might not be relevant with SL 4.0
Also i am having one good link for comparison between ASP .Net Ajax with Silverlight (here)
EDIT :
I have also found Technical Article series in code project (Just Type # google "Adventures while building a Silverlight Enterprise application" and you will get it, i am trying to analyze this series as well)
Please add some pros and cons if you find as i am trying to analyze it from all the angles. It will be of great help if you find any whitepaper on it.
The Pros and Cons have to be weighed against your own requirements.
Rich UI
Compared to what? Its not really a Pro, other tools can deliver Rich UI, where does one draw the line that allows a UI to call itself Rich? A Pro can't be a Pro if can't be measured.
Excellent User Experience
That isn't a Pro either. I wish I could buy product that delvers such a thing out of the box. The reality is it's up to you to deliver the UX. E.g. Stackoverflow delivers an excellent user experience, it doesn't use a tool like SL and it's entirely down to good design not the tool (ASP.NET-MVC+various other tools).
Reduction of Scalability Concerns
Compared to what? Early ASP.NET Forms with extensive use of callbacks then yes. However plain old HTML with Javascript frameworks can deliver this same "Pro".
Speed of Development
Well that depends on how you measure speed and how you weigh the importance of the UX. Currently SL developement isn't any better at ticking off business function points than other tech like poor old ASP.NET Forms and is probably worse. However delivering those same function points with a slick, imaginative UI may tip the balance more in WPF/SL's way. In reality SL allows you deliver more UX with some (but importantly not prohibative) extra effort.
Other Rich Features in SL4
Only a Pro if they would actually add value to your requirement.
Cross Platform
Do you really have a Cross Platform requirement? Within a warehouse business how many Linux and Mac desktops are there? That should answer your cross platform question.
Cross Browser
Is this a Con? Does the company in question allow the use of a variety of browsers? If so which? You can compare that to the browsers SL4 supports and out pops your answer but its your answer not everyones answer. Isn't cross-browser a bigger concern for the Extranet-esq part of the app?
Learning Curve
In all of these factors what are you already versed in is by far and away the most important. I'm guessing its MS tools and in particular .NET, right?
If you're not familiar with WPF already there is some learning curve but its not very steep. However you should definitely make sure you take the time to perform some training projects before you even start designing your real product. That process should help you measure how long it will really take and whether it is really feasable.
Other Known Risks
SL is still very young and it won't sit still. Frustrating "issues" will eat time.
Other questions to ponder
What UX ideas do you have that can't be delivered by a browser?
Why deliver the app via a browser hosted app at all? A WPF application not an option?
Silverlight 4
Considering your timescales if you do choose Silverlight you should target SL4.
Since you are developing solution for the warehouse, you may need consider building a web service with wcf pollDuplex (basically push data from server to the client periodically), just a note on it: it is not (yet) a very scalable and reliable (prior to SL4). Default concurrent connection is 10 (if I remember well), and you have the option to overwrite this default number, however, I haven't find a way to dynamically change this number which turns out to be a scalability issue.
One cool feature I like about SL 4 is the added support of printing, now you have the built-in ability to print the content.
Anyone bulding an Enterprise LOB with a Silverlight client should take a look at John Papa's PDC video.
However, IMHO the initial release of RIA Services was too limited. Now that the next version is buit on top of WCF Services, and the endpoints can be switched out to make them more accessible by more UI clients RIA Service is probably a very sensible investment too.

Java and tomcat vs ASP.NET and IIS

Until recently I'd considered myself to be a pretty good web programmer (coming up for 10yrs commercial experience on a variety of e-commerce, static and enterprise applications). I'm self taught and have always used the Microsoft product stack (ASP, ASP.NET)...
My applications are always functional, relatively bug free, but have never been lightening quick. As a frequent web user I always found this to be the norm... how fast are the websites from the big tech players (eBay, Facebook, Microsoft, IBM, Dell, Telerik etc etc) - in truth none are particularly fast. I always attributed this to "the way things are with web apps"...
...then I cam across a product called Jira from atlasian and this has stopped me in my tracks...
This application is fast, and I mean blindingly fast.. too fast to time the switches between pages, fully live content, lots of images and data and cross references etc etc...
I run this on an intranet, with a large application DB, and this is running on a very normal server (single processor, SATA HDD, 8GB RAM).
Am I missing something?? Are my programming techniques that bad?? I am wondering if this speed gain is down to it being written in Java and running on Tomcat.
Does anyone have any benchmarks to compare JSP / ASP or Tomcat / IIS???
Thanks,
Mark
NOTE: this isn't a blatant plug for Jira. I don't work for them or have any affiliation to them... but I would like to be able to write applications like them :)
YMMV. But one of the longest-lived Things That Aren't True Anymore is the assertion that "Java Is Slow". Excepting floating-point (where most Java implementations aren't at liberty to use the floating-point hardware), Java is generally as fast or faster than compiled code. Some of the best and brightest have spent years of effort ensuring this, including such things as dynamic recompilation/re-optimization of code based on run-time metrics - something that statically-compiled languages like C or assembler cannot boast.
ASP is sort of the opposite extreme, since the original ASP had to recompile each page request each and every time it was made. ASPX addressed this by allowing retention of the compiled page code. That got rid of a lot of useless overhead.
A more compelling reason to prefer Java over ASPanything/IIS is freedom. A Java/Tomcat webapp will run under almost any OS on almost any hardware. IIS runs on Windows. Period. And for the most part, that also means Intel. Not Sparc, Not zSeries. Maybe you don't care. But then again, maybe next week IBM will offer your employer a can't-refuse deal on a mainframe.
I don't have benchmarks, and there are a lot of things that can make one platform preferable. But I permanently gave up on the "Java is slow" idea when I encountered the Poseidon UML tool with its cool real-time graphics UI and the FreeMind mindmapper tool. A small hit to startup the JVM, but after that, you'd never know what language you were working under.
The great debate. Java vs. .Net.
When .Net first came out there was an application written called "The Pet Shop." Which was a .Net port of Sun's J2EE reference application, "The Pet Store". It was announced that Microsoft's implementation was "faster."
As with anything, especially anything to do with marketing, you have to dig deeper to find the truth.
Any technology can be fast with enough hardware and the correct design.
In my experience there are two factors to speed: What type of hardware is used and how you architect your application (this includes database tuning).
Caching at various levels (response, db, etc.) makes a huge different in responsiveness of a web application. There is also a lot of things that are done to reduce time consuming operations like db connection pooling, sql statement caching, etc. As much as I'd like to say Java is better :-), I think in this case the performance is due to the way Jira was written and the fact that it's being run internally (probably with few users as compared to eBay, Facebook, Microsoft). This site, Stackoverflow, uses ASP.NET MVC and IIS and is very responsive and my guess (since code is not open sourced, yet) is that they use many of the same techniques you would find in Jira or any other web application built to scale.
I think that it is not typically the frameworks and languages used that make an application slow. In my experience, some frameworks like JSF or .NET server side controls give developers alot of freedom to make too many database calls and look things up too often, but that's definitely not the fault of the framework used.
Keep your application as light as possible and focus on keeping the data sent to the client as small as possible, and you will have a fast application. It's usually faster to develop fast applications too.
The Jira folks have written a best in class application (and charge for it) - nice work crocodile dundees.
I also suggest to consider also two aspects:
the maintenance activities: logging and deployment. In my opinion under a unix like server is more easier to log, deploy, and maintain new release than doing the same on a Windows server.
if the project require to use some open source application (i.e. Alfresco repository) Java is better solutions
People's opinion is mostly biased. Most people have never really tried the other while claiming the other is slower. I wouldn't trust any answer: it's mere opinion. It's boring to always read the same 4 cents again and again.

Resources