Section B.5. Creating a Profile


B.5. Creating a Profile

Usually you will simply use an existing profile that is built into your UML tool or one provided by a standard source such as the OMG. However, if you find that there simply is no standard profile available, then many UML tools will allow you to create your own.

Be careful when creating your own profiles. The real power of profiles only comes when they are standardized and in common use, discussed in "Why Bother with Profiles?" later on in this chapter.


Your UML tool may allow you to create a profile using a simple text entry dialog; for example, it may ask you for the name of the stereotype and ask you to choose what type of element it can be applied to. However, the behind-the-scenes graphical model of a profile looks like the one shown in Figure B-6.

Stereotypes defined in the profile are themselves given the standard stereotype <<stereotype>>. Two new stereotypes are declared in Figure B-6: WebService and Exposed.

To show that the WebService stereotype can be applied to classes an extension arrow points from WebService to Class. The extension arrow has a solid arrowhead and it connects the new stereotype to the element type that it can be applied to. The extension arrow is also used to show that the Exposed stereotype can be applied to operations.

If the stereotype has tagged values, they are listed in a compartment below the stereotype name. The WebService stereotype has two tagged values: service and encoding. The possible values of these tagged values are shown in the enumerations ServiceStyle and EncodingStyle.

Finally, any applicable constraints on the use of the WebService and Exposed stereotypes are specified in notes. The Exposed stereotype has a constraint, in curly braces, that specifies that it can be applied only to operations of classes that are themselves stereotyped as a WebService.

Figure B-6. Creating a new profile that contains two stereotypes, Exposed and WebService, and some associated tagged values and constraints





Learning UML 2.0
Learning UML 2.0
ISBN: 0596009828
EAN: 2147483647
Year: 2007
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net