From VB 6 to VB .NET: Making the Move -- Part II
In Part II of a two-part series on migrating developer skills and enterprise assets from VB to VB.NET, the senior technical team from Greystone Solutions provides developers a key checklist for moving from VB to VB.NET, including .NET compatibility; use of ASP .NET and ADO .NET; and migrating existing applications to .NET technologies.
and Rachel Prabhakar
In Part II of a two-part series on migrating developer skills and enterprise assets from VB to VB.NET, the senior technical team from Greystone Solutions provides developers a key checklist for moving from VB to VB.NET, including .NET compatibility, use of ASP .NET and ADO .NET, and migrating existing applications to .NET technologies. (Part I of From VB 6 to VB.NET is available here)
.NET Compatibility Issues
Some of our clients have expressed concern about installing .NET on their machines, fearing that installing the Visual Studio .NET environment or the .NET Framework would break other development and production systems. In our experience, however, Visual Studio .NET and the .NET Framework play very nicely with other systems. Our developers run Visual Studio 6 and Visual Studio .NET side by side on their machines, without experiencing compatibility problems. In general, we've been pleasantly surprised with the reliability and compatibility of .NET. When we deployed our first .NET application, in the first half of this year, we were happy to find that we could put it into production without workarounds or hot fixes.
Web Applications: The Next Generation
If you've been writing web applications on the Microsoft platform, chances are that you've been using some combination of ASP on the front end, COM objects in VB or C++ in the middle tier, and ADO to access the data sources in the back end. How will things change in .NET?
For one thing, ASP .NET is significantly better than the previous version of ASP. You can now use inheritance for your ASP pages, thereby eliminating a lot of clumsy include files and various hacks. With ASP .NET, it is much easier to maintain state, and you get validation for free. In addition, you can now drag and drop controls on the page. The server controls of ASP.NET bring event driven programming to Web applications, blurring the distinction between Web programming and client-server programming.
While these new features greatly increase the power and ease of use of ASPs, it can take a while to understand the new model. In particular, it will take quite a bit of reading and practice to understand what should now happen on the client and what should happen on the server.
You should also be warned that it isn't easy to add ASP .NET pages to an existing ASP application. There are substantial differences between ASP and ASP .NET, and unfortunately, session objects cannot be shared between the two types of pages.
If you are designing and developing a new web application, you'll probably use .NET objects rather than COM objects in the middle tier. You can encapsulate your business logic in .NET objects written in VB .NET, C#, or a variety of other languages, just as you formerly did with COM objects. However, with .NET objects, you no longer have to worry about registering dlls and maintaining binary compatibility. With .NET, you can even have multiple versions of the same dll running on the same machine. The appropriate version of the dll will be called depending on the physical location of the dll file. All of the registry headaches simply disappear.
If you are extending an existing application that uses COM objects, don't worry. Microsoft provides wrapper classes so that you can continue to call existing COM objects, though you may take a performance hit.
Just as ASP and VB are significantly changed in .NET, ADO .NET also introduces new features and capabilities. If you are familiar with the current ADO, the concepts of ADO .NET won't be terribly challenging and ADO .NET offers some real advantages. For example, in ADO .NET you can create a data source containing multiple data tables, each with its own source. You can specify relationships between the data tables independent of the table relationships in the underlying database. In addition, ADO .NET uses XML to transmit and persist datasets, making it easy to exchange data with other components that use XML.
In general, the .NET way of doing things gives you much more power and flexibility, easier maintenance, and better debugging. For example, an application we recently developed makes heavy use of inheritance on both the front end and the middle tier. Using ASP inheritance on the front end we were able to handle common processing on parent pages, while allowing child pages to extend and modify the processing as needed. For instance, we significantly extended the vanilla Microsoft grid control, and we were able to incorporate the extended version on a parent page. Child pages were then able to make use of the control automatically. In the old version of ASP, it would have been quite complicated to develop and maintain this kind of functionality. In addition, our application used four different data sources. By employing inheritance in the middle tier, we were able to provide a completely unified interface to the front end.
Migrating Applications to .NET
The changes introduced in .NET are so fundamental that for most applications, migrating to .NET will be more a matter of re-writing than conversion. Microsoft does provide conversion utilities for VB and ASP, but these are of limited use. IT managers will have to give careful consideration to questions such as if, whether, and how existing applications should be upgraded to .NET.
Overall, we've been quite impressed with .NET. We've been pleased with the compatibility and reliability of the technology, and we've found that .NET offers a considerably faster, easier, and more powerful way to develop web applications. Nothing in this world is perfect, though, and there are a few downsides - for instance, the incompatibilities between ASP and ASP .NET are disappointing. In addition, it is important for IT managers and developers to understand that migrating applications to .NET is likely to be difficult, complex, and time consuming.
Barry Wolfield is vice president of client services at Greystone Solutions. Rachel Prabhakar is senior .NET developer at the same firm. Greystone is a Microsoft Gold Certified Partner for E-Commerce Solutions based in Woburn, Mass.