Other Stereotypes on Classes


There are other built-in stereotypes that may prove useful in helping you define classes. These stereotypes are as follows :

  • Two stereotypes differentiate between primary and secondary logic or control flow. The ‚ «focus ‚ » stereotype signifies that a class provides primary logic; the ‚ «auxiliary ‚ » stereotype signifies that a class supports one or more ‚ «focus ‚ » classes.

    Within Figure 1-24, the GLReport class contains logic for formatting and printing a report that contains information provided by the General Ledger class.


    Figure 1-24: Auxiliary and focus stereotypes

  • Three stereotypes signify sets of values that have no identities and that can't be changed by operations.

    The ‚ «dataType ‚ » stereotype is the "parent" stereotype. Figure 1-25 shows two examples of user -defined data types.


    Figure 1-25: Data types

    The ‚ «enumeration ‚ » stereotype signifies an ordered list of literals. Figure 1-26 shows an example of a user-defined enumeration.


    Figure 1-26: Enumeration

    This enumeration might be a useful alternative to the BookAndAuthor class that appeared earlier in the chapter. If that class weren't present, it's likely that the Author class will have an AuthorRole attribute.

    The ‚ «primitive ‚ » stereotype signifies a data type built in to the UML. There are four primitive types: Boolean, Int, String, and UnlimitedNatural. (The latter is equivalent to "real.")

  • The ‚ «utility ‚ » stereotype signifies that the attributes and operations that belong to a class all have class scope ‚ in other words, the attributes and operations define data, or operate on data, for the class as a whole, as there are no instances of the class.

  • Two stereotypes offer a way to differentiate classes when you start modeling implementation.

    The ‚ «specification ‚ » stereotype signifies that a class specifies the characteristics of a set of objects without defining the physical implementation of those objects.

    The ‚ «implementationClass ‚ » stereotype signifies that a class provides a static physical implementation of its objects. An implementation class is usually associated with a static class within a programming language, such as C++.

  • You can use ‚ «stereotype ‚ » itself as a stereotype to signify that a class is itself a stereotype that can be applied to other elements of your model.

    Within Figure 1-27, the class HTMLPage also serves as a stereotype that applies to FormPage and InformationalPage.


    Figure 1-27: Stereotype as stereotype

  • The ‚ «metaclass ‚ » stereotype signifies that all instances of a class are themselves classes. For example, Class is the metaclass of classes you've seen to this point, such as HTMLPage. This is useful if you're exploring more expansive ways to expand the UML. Unfortunately, metamodeling is beyond the scope of this book.




Fast Track Uml 2.0
Fast Track UML 2.0
ISBN: 1590593200
EAN: 2147483647
Year: 2004
Pages: 97

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