In this article, we look at the internals of Wisej.NET as an alternative to traditional ASP.NET for web development, particularly in the context of migrating legacy Windows Forms applications to the web.
In this context, Wisej.NET represents an alternate, and fairly unique, option.
At first glance, Wisej.NET looks like yet another library of controls and components for allegedly rapid ASP.NET-based web development. True, but not exhaustive. Actually, Wisej.NET is a full platform tightly integrated with Visual Studio aimed at building and debugging ASP.NET Core applications. To qualify an otherwise conventional ASP.NET Core application as a Wisej.NET application, you just need to attach a custom piece of middleware in the startup.cs file.
As Wisej.NET is ultimately also a library of tailormade components, you also need to reference a client-side framework that will drive any further interaction between the client and the server environment.
Wisej.NET supports various types of web templates that ultimately result in prepackaged projects for a number of scenarios: plain web application but also web desktop application, web page application and user control library.
In which way is Wisej.NET different and relevant?
The Perfect Use-Case
A Wisej.NET application is based on a container named Form. The Form is a collection of visual elements each of which holds a physical position within the container and exposes a number of visual and nonvisual properties. The Visual Studio dedicated environment supplies a toolbox of components to create any necessary markup in a GUI-driven way. Any client/server interaction takes the form of an event triggered on a visual component that some handler will process.
All handlers are programmed in a companion class file that goes hand-in-hand with the Form container. This code-behind class has the same relevance of a controller class in a plain ASP.NET Core MVC application. Put another way, the set of all code-behind classes of a Wisej.NET application form the presentation layer of the new web application. From there, you can simply connect the public endpoints of your existing Windows Forms application backend or create a bunch of new layers (e.g., application, domain, infrastructure as in domain-driven design).
Wisej.NET can be used to build any classic or single-page web application but its primary use-case remains the migration of a Windows Forms legacy application to a modern, highly interactive and responsive web application.
At the beginning of the .NET development era, the vast majority of developers were coming from client/server development and Web Forms for the web, and Windows Forms for desktop, provided a unified programming model that made knowledge of web technologies little or no relevant at all. A lot changed since then, and the abstraction layer on top of raw web development became progressively thinner. UI frameworks such as Bootstrap made a good attempt of raising the abstraction again but all they achieved was graphical. New conceptual components were born (e.g., navbar, input groups, dropdown menus) but still requiring explicit tons of HTML and CSS and completely devoid of behavior.
Wisej.NET brings the clock back to the time in which programming web applications shielded developers from having a significant grasp of web technologies. It’s a pleasant discovery for the newest generations of programmers and a healthy return to the origins for those still engaged in legacy Windows Forms applications.
A Look at the Internals of Wisej
Wisej.NET is a web development framework with the following unique characteristics.
- Single Page application
- Abstracted frontend technologies
- Real-time updates to UI
The last point is fairly interesting. The behavior of a typical Wisej.NET application, in fact, internally resembles closely the behavior of an ASP.NET Server Blazor application. (See Figure 1.) In a Blazor application, after an initial negotiation between the browser and the application backend, it’s a continuous exchange of web sockets packets transmitting request details and receiving DOM updates.
FIGURE 1 – The ASP.NET Server Blazor architecture
The similarity with the ASP.NET Server Blazor architecture ends at the layout level, as the exchange protocol, including format of data sent and received, is proprietary.
What About Plain ASP.NET Core?
A Wisej.NET application is therefore an ASP.NET Core application. Why not use ASP.NET Core then? There are two main debatable points. ASP.NET has a large and active community, which means you can find plenty of resources, tutorials, and libraries to support your development. Wisej.NET is a proprietary product with excellent documentation and tutorials but nowhere near to the community of a general-purpose web platform made in Microsoft as it is ASP.NET. On a much more technical tone, it should be noted that ASP.NET allows you to have more direct control over the front-end technologies used in your application. This can be beneficial if you have specific design or functionality requirements but detrimental in the perspective of rapid application development. And quite problematic if you have a legacy Windows application to turn into a web application.
Wisej.NET runs on top of ASP.NET Core but provides its own programming model, much closer to ASP.NET Web Forms than to ASP.NET MVC. As a result, it’s about two fairly different programming platforms whose only point in common is the programming language whether C# or Visual Basic.NET. The way you design the presentation layer and connect a client event to a server-side handler is radically different and so it is for the startup of the application and a number of configuration aspects.
A Wisej.NET application blinks to the application internal organization of ASP.NET Web Forms and uses the ASP.NET Core hosting runtime just to inject its own middleware and gain access to the server file management.
It’s not a matter of voting what’s better and what’s worse: it’s two different things that do the same job of building modern web applications. Of these two platforms, you have to choose one. Which one, then? Not surprisingly, it depends on your needs and your skills.
A Thoughtful Choice
The first decision point is whether you are looking for building a new application from scratch or migrating an existing ASP.NET Web Forms or Windows Forms application. In the latter case, Wisej.NET represents by far the primary option to evaluate. It may still not be ideal for you, but it’s definitely an option you might want to check. On personal experience, a large Windows Forms application with a few custom painting functions has been made deployable on the web in days by a small team of two people with no external help from consultants and only based on publicly available documentation.
What kind of people?
They were experienced and seasoned developers with a solid database background and a technical learning path rooted in the Web/Windows forms model. We were so happy that started considering the option of using Wisej.NET also for newer projects to build from scratch or evolve from a native ASP.NET Core foundation.
In doing so, though, we found out that for developers with no previous exposure to the Forms-based programing model of the early 2000s the Wisej.NET model looked weird at the minimum. Nothing that a brilliant developer can’t grasp in weeks but still a new learning path to go through.
In summary, choosing between Wisej.NET and ASP.NET depends on your specific needs and background. If you're more comfortable with desktop development and want a component-based approach with real-time updates, Wisej.NET might be a good fit. On the other hand, if you're looking for a more flexible and versatile framework with a strong community and integration with Microsoft technologies, ASP.NET could be the better choice. Always consider the current state of the technologies and your project requirements when making a decision.
If you want to learn more about Wisej.NET in comparison to Blazor, you may want to check out this article:
After 20+ books (mostly with Microsoft Press) that educated two generations of developers, 1000+ articles, hundreds of conference talks and 10000+ hours of training, Dino returned to software development and architecture. After two years spent in the energy sector, within his role as CTO of Crionet he now leads the engineering team that runs every-day, worldwide operations for professional tennis and padel spreading various forms of innovation in the whole sport-tech industry.