Section B.7. Using a Profile


B.7. Using a Profile

The model in Figure B-6 shows how to create the Web Service profile. To actually use the profile, you apply the profile to the package that will use it.

To apply a profile to a package, draw a dashed arrow from the package that will use the profile to the profile, with the <<apply>> stereotype along the arrow as shown in Figure B-7.

Figure B-7. Applying the Web Service profile to the CMS package allows you to use the Web Service profile in your CMS model


Not all UML tools use this method for applying a profile to your model. For example, it may let you specify which profile to apply to a package using a dialog box.


Now that you've applied the profile, you may use the profile in your CMS model, as shown in Figure B-8.

Figure B-8. Applying elements of the Web Service profile to the BlogFeedService class in the CMS package


In Figure B-8, the BlogFeedService is marked with the WebService stereotype. Its single method is marked with the Exposed stereotype, allowing it to be exposed through the web service. The tagged values for the WebService stereotype are attached in a note, populated with values from the enumerations.

The constraint from the Web Service profile isn't explicitly seen in this model, but it is used because the Exposed stereotype on the getFeed( ) operation is contained in a class that uses the WebService stereotype.




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