Jumat, Juli 27, 2007

Migrating to Visual Basic.NET from Visual Basic 6 (2) - Upgrading to Visual Basic.NET

Migrating to Visual Basic.NET from Visual Basic 6 - Upgrading to Visual Basic.NET
(Page 2 of 7 )

Though VB.NET is a next version of Visual Basic, it takes quite a different approach to development of applications. Visual Basic..NET shifts focus from traditional development of applications to n-tier or web applications. Since, this was a total change of approach, rather than adding new features to the existing version, Visual Basic has been redesigned to facilitate rapid development of these applications.

VB.NET is now fully integrated with other Microsoft .NET languages. We can now use cross language support to develop the Web and n-tier applications easily. To provide full access to the platform and to ensure that Visual Basic moves to the Web development, it was necessary to build an altogether new platform. In order to take full benefit of this, the Visual Basic 6 projects need to be upgraded to Visual Basic.NET.

Once again, due to its totally different nature, upgrading to Visual Basic.NET is not as straight forward as opening a project from Visual Basic 6 in Visual Basic.NET and running it. Though Visual Basic.NET provides a wizard for the job and it automates the task fairly well, there are quite a few things that the developer will have to look into and handle manually.

Architecture Recommendations

The .NET improves upon Visual Basic 6 architectures adding greater support for scalability and distributed applications through ADO.NET’s disconnected data access. Whenever upgrading from Visual Basic 6, it will be beneficial to keep the following points in mind.

Browser Based applications
Use Microsoft multi-tier architecture guidelines, create interface in ASP and develop business logic using Visual Basic
It is mostly not possible to upgrade the DHTML applications and it is best to leave them in Visual Basic 6
ActiveX documents are not supported in Visual Basic.NET. They should either be left in Visual Basic 6 or should be converted to UserControls
Client Server

We should keep in mind that Visual Basic.NET uses a new form package. Though largely compatible, Windows Forms has a different object model.

Visual Basic.NET introduces new middle-tier component, Web Services. Web Services are hosted by ASP.NET and use the http transport. This facilitates penetrating the firewalls. These services pass and return data using XML and hence the information can be used by any platform.

Single Tier

These are the applications that normally store data in let us say Microsoft Access. They will upgrade with some limitations. Visual Basic.NET has moved away from the old extensibility model because of its language neutral approach and hence the extensibility objects will need to be changed to take full advantage of the new model

Data

Visual Basic.NET supports DAO and RDO in a limited sense. It does not support DAO and RDO data binding to controls, data controls or RDO UserConnection. Visual Basic.NET supports the ADO and Microsoft recommends using ADO for connected data requirements in place of DAO and RDO

Upgrading

When the Visual Basic.NET Upgrade Wizard upgrades the code, it changes some of the data types and a few other things.

Variant

Visual Basic 6 supported variant data type, which could be assigned to any primitive data type, Empty, Error, Nothing and null but Visual Basic.NET does not support this data type. The functionality is now given to to object data type

Integer

In Visual Basic.NET, 16-bit whole numbers are called short and integers are now 32-bit numbers while longs are now 64-bit. While upgrading your project, the integers will be converted to short and longs to integers

Properties

The changes in property syntax has now become more intuitive It groups Get and Set together as a part of a single block.

Forms

Visual Basic.NET has a new Forms package and when you upgrade an existing application Visual Basic.NET automatically converts the Visual Basic 6 forms to Visual Basic.NET

Tidak ada komentar: