
Generate Code from UML #81
Chapter 10, Work with Visual Studio Tools
|
357
HACK
public string Year;
public virtual void Accelerate( )
{
}
public virtual void Decelerate( )
{
}
public virtual void Drive( )
{
}
public virtual void Start( )
{
}
public virtual void Stop( )
{
}
}// END CLASS DEFINITION Vehicle
As you can see, Visio does an adequate job of generating code for your
classes and can save you an immense amount of time, especially if you have
a class library with a lot of classes that contain a lot of properties.
Hacking the Hack
You’ve seen that Visio does a pretty decent job of generating your class code
right out of the box. But what if you didn’t quite like the way it generated
Figure 10-36. Generated class files in the Solution Explorer