Gizmox > Platform > Windows Forms Development and Migration

.NET Windows Forms Development & Application Migration

 

Windows Forms API development: Application development success depends on few major factors, it is of course a result of well defined requirements, engineering and planning, skilled developers, wide and capable infrastructures which is flexible enough and thorough enough.

Migration solution: Visual WebGui is probably the most natural technology for converting .NET Windows Forms, VB6 and practically any other desktop technologies to the web. This fact directly involves the Windows Forms API which was chosen to be used with Visual WebGui.

.NET Windows Forms API Development Overview

Visual WebGui is making all of the above prerequisites much easier to achieve:

Ensuring Well Defined Requirements at an Early Stage

Having a powerful WYSIWYG form designer, makes it very easy to create pre-development prototypes in no time based on general requirements and perform expectations coordination at a very early stage.

WinForms Designer

Assisting Engineers to Create the Best Architecture

Being .NET Windows Forms identical development paradigm, it is only natural to use the most proven and advanced development patterns such as: MVC, Command, Observer, Service Locator and many others.

The engineers can concentrate on building the most flexible objects model and they don’t need to find solutions for the multipart architecture of the web. 

Visual WebGui enables the use of UIP application blocks and the CAB methodologies which are the most advanced infrastructure patterns for desktop development.

Creating Skilled Developer Teams

Leveraging existing skills sets of the most common development knowhow which is the natural evolution of VB6 development approach makes it possible to easily create the suitable team for any application development task.

VB6 Evolution

Infrastructure flexibility and wideness

Based on the generic API of the .NET Windows Forms and enjoying the fact that it’s still ASP.NET based web under the hood, Visual WebGui offers a very wide solution. Starting from stand alone applications development through mash-ups and ending in highly interactive and data centric add-ons.

Visual WebGui offers the ASP.NET FormBox control which enables ASP.NET based applications to contain Visual WebGui applications. The image below shows a large testing central application by SAP (called SNAP), which combines Visual WebGui with ASP.NET.  The data centric and interactive part in the middle is Visual WebGui and the surrounding “frame” is ASP.NET.

Infrastructure flexibility

Combining Visual WebGui application within an ASP.NET is done in the most standard way of adding ASP.NET controls to a Web Forms:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="VWGLibraryOne.WebForm1" %>
<%@ Register Assembly="Gizmox.WebGUI.Forms" Namespace="Gizmox.WebGUI.Forms.Hosts" TagPrefix="vwg"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
    <body style="background-color:Silver; font-size:small;">
      <form id="form1" runat="server">
        <div>
        This is an ASP.NET Page.
        <br />
        <asp:Literal runat="server" ID="mobjLiteral" />
        <br />
        <br />     
<vwg:FormBox id="FormBox1" runat="server" Stateless="false" Height="480px" Width="640px" Form="LibraryForm">
</vwg:FormBox>
 </
div>
 </form>
</body>
</html>

The opposite option is a Visual WebGui application being able to contain an ASP.NET application. This option is provided in the form of a control named AspPageBox in Visual WebGui. The following image illustrates the usage of an AspPageBox control, which is simply dragged into a Visual WebGui form:

Visual WebGui form

The next step would be to set the .aspx path into the appropriate property:

        private void Form1_Load(object sender, EventArgs e)
        {
            this.aspPageBox1.Path = "/MyAspNet/WebForm1.aspx";
        }

Furthermore, any interaction between any client technology such as: Flash, ActiveX, Silverlight (Xaml), JavaApplet etc, can be easily combined and interacted within Visual WebGui applications. The image bellow illustrates combined document viewer JavaApplet within Visual WebGui application:

Visual WebGui Management Application

Complete Data-binding options make it possible to again concentrate on the business logics of the application as opposed to struggling with various techniques for binding UI to data.

The following three steps process, illustrates how easy data-binding  may be using .NET Windows Forms tools to develop web applications with Visual WebGui:

  1. Drag data control, in this case DataGridView:

  2. Use Linq to SQL to add dynamic data-source to any DB tables:

  3. Bind the Control to the newly created data-source:

The short process above, binds a very sophisticated and capable UI control such as a DataGridView to the data behind using the latest LINQ technology in 3 minutes, providing a fully functional bi-directionally bounded grid of data.

Other productive advantages of using the .NET Windows Forms API development for building business applications for the web:

Layout options: Docking, Anchoring, Tab-Control, Panels etc.

Layout options - docking / anchoring

Single layer code maintenance; while maintaining standard web applications forces you to write and maintain multilayered application:

  • Client: JavaScript, CSS, Html, Xslt, Flash, Silverlight …
  • Server: ASP.NET, JSP, PHP, Web Services ...

Visual WebGui is coded and maintained through a single code base of C# pure object oriented .NET Windows Forms identical, widely documented and easily maintainable code.

Windows management is seamlessly handled by Visual WebGui upon using the standard .Show() and .ShowDialog() methods on standard form objects and is enabled on any plain browser (IE, FireFox, Netscape, Chrome, Safari).

Passing through parameters and receiving returned data back from dialogs is done through normal OOP channels (different c’tors, properties and public methods).
The following code shows the way to consume dialogs in Visual WebGui:

Opened form code (Form2.cs)

            public partial class Form2 : Form
            {
 public Form2()
                  {
            InitializeComponent();
                  }
 
                  public Form2(Object objMyParams)
                  {
                        //...
                  }
            }

Form2 opening code:

            private void button1_Click(object sender, EventArgs e)
            {
                  Form2 objForm2 = new Form2(new Object());
                  objForm2.ShowDialog();
            }

Application Migration Solution Overview

As thoroughly described in the Windows Forms API development section above, Visual WebGui implements the .NET Windows Forms identical API, in addition, it provide generic purpose object model consumable from any device which can send and receive XML as described in the “Multiple presentation layer” aspect section above.

Any migration of any product from one technology to another must be defined as a project, the question is what can be done to make this process as natural as possible and at the end, deploy fully functional application on the web with the lowest costs.

Visual WebGui mimicks the .NET Windows Forms API which raises the bar for any existing alternative as it can consume almost the same code base used in .NET Windows Forms with some well known exceptions. This allows to reach a compiling and working application in the shortest term, as well as with the migration of Windows Forms applications.

The following three articles, describe the different migration scenarios of desktop applications to the web using Visual WebGui:

Application migration – part 1 – .NET Windows Forms to ASP.NET Web
Application migration– part 2 – VB6 to ASP.NET Web
Application migration – part 3 – Smart Client Technologies to Web

Next >>