Friday, September 12, 2008

Migration from VB 6.0 to VB.NET

Advantages of Migration:

Visual Basic .NET is the next version of Visual Basic. Rather than simply adding some new features to Visual Basic 6.0, Microsoft has reengineered the product to make it easier than ever before to write distributed applications such as Web and enterprise n-tier systems. Visual Basic .NET has two new forms packages (Windows Forms and Web Forms); a new version of ADO for accessing disconnected data sources; and streamlined language, removing legacy keywords, improving type safety.

Visual Basic .NET is now fully integrated with the other Microsoft Visual Studio .NET languages. Not only can you develop application components in different programming languages, your classes also can now inherit from classes written in other languages using cross-language inheritance. With the unified debugger, you can now debug multiple language applications, irrespective of whether they are running locally or on remote computers. Finally, whatever language you use, the Microsoft .NET Framework provides a rich set of APIs for Microsoft Windows® and the Internet.
Visual Basic is now a true object-oriented language; some unintuitive and inconsistent features such as GoSub/Return and DefInt have been removed from the language.
Error handling in VB.NET has considerably increased the efficiency of the applications and free threading is a plus point as against to single threading in Visual Basic

Problems in Migration:

The following features in VB projects are not supported in the VB.NET environment:
OLE Container Control
Dynamic Data Exchange (DDE)
DAO or RDO Data Binding
Visual Basic 5.0 Controls
DHTML Applications
ActiveX Documents
Property Pages

While migrating from VB to VB.NET you should not use late binding and lines and shapes are not supported in VB.NET. Instead you can make use of images. Moreover, in VB.NET you have to use only Zero-Bound array.

Strategy of Migration:

Migration Wizard / tool:

I) Use the microsfot assessment tool to analyze the migration effort.
http://msdn.microsoft.com/library/?url=/library/en-us/dnpag2/html/VB6ToVBNetUpgrade.asp
Please find attached Migration Strategy diagram


II) Migration through Visual Studio IDE Wizard:
Visual Studio IDE has a menu item to bring up a wizard needed for migrating either VB or Java programs to .NET World. Everything in VB may not go to VB.net
http://www.codeproject.com/KB/vb/Migration.aspx

Fresh Design:

Redesign the entire applicationt to dotnet. you can use below techniques

1. Do a UML design of your whole application (if it is not available earlier)

2. Identify the functions/Subs in VB 6.0 which can be grouped as classes and components, identified in UML. If your team has done a better coding by following std. coding practice then forming components can be easily done.

3. Wrap the classes by providing appropriate access specifiers which will give way for covering security aspect of your project

4. Try to fit in your application in any of the standard patterns, this may require code change. But the benefit you get is easy maintainance and better effort estimation. Atleast follow a 2-tier architecture

5. Once the basic steps are done, then you can start replacing the code by .Net featured code (like string manipulation, multi-threaeding, security protocol, delegation, remoting etc)

successfully migrated solution!

2 comments:

  1. Nice information for vb to vb.net and problems in migration.

    ReplyDelete

 
web counter
Download a free hit counter here.