1. Home
  2. Computing & Technology
  3. Visual Basic

Refactoring Tools for Visual Basic
Refactoring Using UML Reverse Engineering

By , About.com Guide

Mar 18 2007

Microsoft's Reverse Engineer UML Modeling

This VB 6 tool isn't strictly a refactoring tool. It might almost be called a "starting over" tool. It was provided free by Microsoft and if you're a large customer, you might have enough clout to get them to give it to you again. ... Even though it's against company policy these days to do anything nice for VB 6'ers.

The Visio Reverse Engineer UML Modeling tool installs as an add-in for VB 6. After it's installed, you have a new toolbar with four new icons in your VB 6 development environment. (See the illustration below.) As of publication date (March 2007), MSDN still had some documentation for using this tool and VB 6 here. But they also have some much more recent instructions (but not the tool) for .NET here. I couldn't find it available for download anywhere but if you have been an MSDN subscriber for a while, you might find it on your CD's. If anyone knows how to get it, please drop me an email.

--------
Click Here to display the illustration
Click the Back button on your browser to return
--------

Visual UML

UML has a deep history and great credibility with a lot of programmers, so you can also buy products from third parties to do the job. One of the most popular is sold by Visual Object Modelers, a company from the Silicon Valley of the Rockies - Boulder, Colorado.

Visual UML also supports both VB 6 and VB.NET. And, like most of the tools reviewed here, it also installs as an Add-in to the Microsoft development environment. But you have to have deeper pockets to get it. They're asking at least $500 for a copy. It's a reasonable price when you consider that a copy of Visio - necessary to do the UML diagramming with Microsoft's "free" tool - will cost you several hundred.

This tool is designed for UML believers and includes the ability to import UML models, create code from UML and export models in addition to being able to reverse engineer existing Visual Basic programs. So you're getting into the UML big leagues if you go for this tool. Like other vendors, they also provide a "free trial" version.

Reverse engineeringing into UML might be called the "gold standard" refactoring technique. "Gold standard" because it's likely to yield the most valuable result and also because it's really expensive. You need extensive training and experience to do UML right. And you also need a lot of time for the analysis, redesign, and reprogramming.

The idea is to create a UML model of the actual running code and, after a thorough analysis, write it again. In other words, "start over." This technique does have the added advantage that you don't have to write the next version in the same programming language. Since Microsoft is leaving us few choices about moving from VB 6 to VB.NET, this might be a more practical choice today.

Microsoft describe the four steps in using the tool as follows:

Step 1: Customize the Development Environment
Step 2: Open the Code Project to Reverse Engineer
Step 3: Select the Reverse Engineer Button
Step 4: Create your UML Diagrams in the Visio UML Model

That last step is the hard one. But the first three steps do give you a head start. The illustration above shows what the tool creates automatically (up to the hard step) for About Visual Basic's VB 6 TicTacToe program.

Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Using VB.NET
  5. Refactoring Tools for Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.