Many Windows development groups have gained .NET expertise over recent years taking a variety of approaches to...
new projects. But for some organizations, the sheer breadth of deployed Visual Basic 6 (and earlier) code has caused a delay in moving to the .NET Framework.
With the advent of the .NET Framework 2.0 and Visual Basic 2005, more organizations have more reasons to revisit their .NET plans, and a new book form Microsoft Press is full of useful advice for teams ready to advance to VB .NET. Upgrading Visual Basic 6 Applications to Visual Basic .NET and Visual Basic 2005 is abounding with practical guidance for the would-be .NET migrator, so SearchVB.com editors recently got together with some of the book's authors to learn more about useful strategies.
First off, better understanding of object-oriented technology remains important to understanding the .NET Framework, but, depending on individuals' roles and the breadth of the project, deep immersion in objects may not be required.
"You have to get your arms around object-oriented technology. Dealing with objects is a fairly fundamental change. Do you have to become an object-oriented developer? Not necessarily," said Keith Pleas, MVP architect and head of Keith Pleas & Associates. Architects and developers charged with creating wide software frameworks do need to become object experts, but others building on such frameworks can still act as successful members of projects without getting familiar with object-oriented programming in VB .NET, Pleas continued.
"If you're building a framework, then you'll need to learn about objects, but if you're building an application on top of that, then objects aren't so important," he said.
What are the first steps one should take after deciding to make the .NET Framework leap? Making an assessment of your target application is a good place to start, said Federico Zoufaly, executive VP at migration specialist ArtinSoft. And, in fact, an assessment tool is available along with the downloadable online version of Upgrading Visual Basic 6 Applications to Visual Basic .NET and Visual Basic 2005. Both the book and the tool are made available under the auspices of Microsoft's Patterns and Practices program.
"Once you decide to migrate, and have identified the issues, the assessment tool will provide an inventory of the [VB] code, what projects you have, what controls you use, and so on. Basically, it sets a baseline for the size of the migration," said Zoufaly. Such information will be important to managers that must carefully scope out a project before dedicating resources.
Upgrading Visual Basic 6 Applications to Visual Basic .NET and Visual Basic 2005 notes that the upgrade process can be addressed in parts. In fact, a chapter is dedicated to some of the ins and outs of hosting some legacy Visual Basic 6 components within the .NET CLR-managed environment.
Experienced developers know that wizards such as those embedded in VB 2005 can be useful learning tools when it comes time to migrate apps. But, of course, they know full well that such wizards have limits. Pleas pointed out that the Visual Basic 2005 Upgrade Wizard is well designed for work on specific projects, but not for handling larger issues like COM library component upgrades. "The assessment tool is designed to help you with that," he said.
In any case, studying the Patterns and Practices group's literature helps before forging ahead with wizard-oriented learning and migration. Using a wizard without background knowledge can lead to frustration. "If you just go straight to the Upgrade Wizard", said Zoufaly, "a lot of warnings will pop up, and if you're not prepared then you may just throw in the towel."
A migration of any kind tends to face a quandary. "As long as this application is being moved over," someone will ask, "why don't we add some features?"
In organizations large and small development managers are constantly pressed to create new functionality, but the essential goal when you move an application is to create a baseline reference of the app and the development team. How long does it take to develop/migrate? What has to be done? Does it still work the same? These are questions you need to answer, but cannot answer with assurance, if your application has morphed into something new.
Said Pleas, "When you add a feature, you are satisfying somebody's need and that can be important if they have the budget." It can be difficult to focus on the objective of learning as you migrate, Pleas indicated, but that is just what is needed if you are to achieve a successful outcome.
"It is very important to separate the actual migration project from further advances, said Eugenio Pace, product manager, Patterns & Practices, Microsoft. "We have found separating the migration [from other functional development] is very pivotal."
"It is important because you now will have a baseline against which you can test. If you had a test [before in the Visual Basic 6 version], the application should now perform in the very same way," he said.
Achieving a "functional equivalent" is crucial, said Fedrico Zoufaly. As Zoufaly, Pleas and their co-authors point out in their migration guide, the process that you use becomes a key factor in upgrade projects. Maintaining functional equivalence as you move into the new technology is highly recommended.
Related VB 6-to-VB .NET links
Visual Basic 6 to Visual Basic .NET Upgrade Guide – MSDN
Visual Basic 6 to Visual Basic .NET Upgrade Assessment Tool – MSDN