Architecting and designing : UML 2.0 Lite : UML models : UML class diagrams : Specifying language properties for a class
  
Specifying language properties for a class
You must specify a language type for a class. If you create a new class outside of a diagram, you must specify a value for its Programming Language property. If you are drawing new classes on a diagram, their programming language property will automatically be set to the language that you have specified in the diagram's properties, Programming Language property.
Specifying a language in the Customize Method Support dialog
1 Select Tools, Customize Method Support, Encyclopedia Configuration.
2 In the Target Languages field, select the one or more languages you want to model with. Selecting a language here will provide you with additional properties for that language within the class, class attribute, and class method definition dialogs. However, this does not affect the types that will be available as you model - attribute types and method return types will be available for all languages irregardless of what language you choose in the Customize Method Support dialog. Click Ok to close the dialog and reopen the encyclopedia for the changes to take effect. (note: if you don't make a change, you don't have to reopen the ecy.)
Specify language properties for classes created by drawing them on the class diagram
1 Create a new class diagram.
2 Open Diagram Properties for the diagram (right-click the diagram workspace and choose Diagram Properties or select Edit, Diagram).
3 Specify the Programming Language for the diagram. Once specified, every new class that you draw on the diagram workspace will automatically have this programming language specified.
4 Draw a class on the diagram workspace. Open its definition (double-click on it or right-click, Edit). Notice that the language that you specified in Diagram Properties is already chosen within the Programming Language property of the first page of the class's definition. You may not change this programming language.)
Specify Language Properties for Classes Created Via the Browser
You may create class definitions directly from the browser. When you create a class definition via the browser, you will be asked to specify a programming language at class creation.
1 Right-click Definition, Class in the browser and select New.
2 Specify the Programming Language for the class, as well as its owning package. Once specified, you will not be able to change the class's programming language (you may later move it to another package).
Specify a Type for an Attribute
1 Select the Attribute tab of the class's definition. Type an attribute name in the grid, and then press Enter.
2 Click the attribute’s Type field. You can then move through the list of available types (the list includes the types available for the programming language you have chosen, and all classes in the encyclopedia).
Specify a Return Type for a Method
1 Select the Methods tab of the class's definition. Type the method name in the grid, and then press Enter.
The method’s definition dialog appears.
2 You may add method parameters in the method's definition dialog. You may also click OK to close the dialog without adding a parameter at this point, and want to add parameters later.
3 Back in the Methods tab of the class definition, click in the Return Type field of the method. You can then move through the list of available types (the list includes the types available for the programming language you have chosen, and all classes in the encyclopedia).
See also
UML class diagrams