
Chapter 19 Working with C#
Class
You design a C# class using a class in PowerDesigner. C# classes can contain events, variables, constants, methods, constructors, properties, and indexers.
The following specific classes are also supported in PowerDesigner:
- New class is used to declare a member with the same name or signature as an inherited member. To design a new class, you have to set the class new extended attribute to True.
In the following example, class DialogBox inherits from class Window. Class Window contains an inner classifier Control, and so does class DialogBox. You do not want class DialogBox to inherit from the control defined in Window, to do so, you have to set the new extended attribute to True, in the Control class inner to DialogBox:
{
public class DialogBox : Window
{
public new class Control
{
}
}
}
- Abstract class is equivalent to an abstract class. To design this type of class you need to create a class and select the Abstract check box in the General tab of the class property sheet.
{
public abstract class Client
{
private int Name;
private int ID;
}
}
- Sealed class is equivalent to a final class. To design this type of class, you need to create a class and select the Final check box in the General tab of the class property sheet.
{
public sealed class SealedClass
{
private int A1;
private int A2;
}
}
Copyright (C) 2006. Sybase Inc. All rights reserved.
|
|