UML for C#
C# is a modern object-oriented language for application development. In addition to object-oriented constructs, C# supports component-oriented programming with properties, methods and events. UML defines graphical notations for describing and designing object-oriented software systems. It’s an open standard controlled by the Object Management Group (OMG). Although UML has many diagramtypes, we’ll focus on class models that show static class structure and relationships. WinA&D is a complete UML modeling tool enriched with C# language specific details used to generate source code. WinTranslator is a reverse engineering tool that scans code to extract design information into WinA&D models. Diagrams created in WinA&D are used to illustrated C# programs represented in the UMLnotation. This paper assumes a working knowledge of C# and UML. It briefly describes how C# constructs are represented by UML for forward and reverse engineering.
In WinA&D, a class model is drawn from a palette of tools. As each class instance is placed on the diagram, it’s named in the Class Properties dialog. Each class has a corresponding dictionary entry of the same name inthe data dictionary. Many diagrams within the class model and in other types of diagram documents share data that is stored in the same global data dictionary. For a selected class object on the diagram, the Details button presents the Class Attributes & Operations dialog. This dialog is used to define members of the class. In WinA&D terminology, a class can have Attribute, Operation, Property andEvent members. Behind the scenes, WinA&D adds a dictionary entry for each class member with a name of the form Class’Attribute, Class.Operation, Class$Property and Class-Event. Each class member has a details dialog for defining language specific information for that class member. WinA&D supports many programming languages for code generation including C#. Depending on which language is currentlyselected, the Attribute Details, Operation Details, Property Details and Event Details dialog will vary slightly based on specific characteristics of the selected language. WinA&D can concurrently store language specific details for multiple languages for each modeling element. When instances of a class are presented on different diagrams, detailed information is stored once in the globaldictionary. WinA&D uses this information to generate source code.
A UML class diagram shows the static class structure of a C# application. Different types of the objects on the class diagram represent C# classes, interfaces, structs and their generic counterparts.
UML Class Diagram with C# Classes
Each class on a diagram is represented as a named box with dashedsections showing a list of class members. Classes are connected with relationship lines. In the diagram above, the Constant, VariableReference and Operation classes inherit from the abstract Expression class. The presentation of a class diagram can vary widely based on user-specified criteria. In the diagram above, class attributes (C# fields) and operations (C# methods) are shown with access, datatype and signature details. WinA&D gives the user a lot of flexibility to control how classes are presented. Class members can be shown or hidden based on member type or specific conditions based on access or modifiers on each class member. Members of a class instance on a diagram can show various levels of detail like its access type, data type or arguments. Presentation options can be easilyapplied across all diagrams, to specific diagrams or to individual instances of a class. Information about classes, class member and C# details are entered into detail dialogs when drawing diagrams and stored in the global dictionary. Instances of the same class can be shown on many diagrams with different presentations.
Class and Interface Relationships
An interface defines...
Leer documento completo
Regístrate para leer el documento completo.