Terms and Concepts
A note is a graphical symbol for rendering constraints or comments attached to an element or a collection of elements. Graphically, a note is rendered as a rectangle with a dog-eared corner, together with a textual or graphical comment.stereotype is an extension of the vocabulary of the UML, allowing you to create new kinds of building blocks similar to existing ones but specific to your problem. Graphically, a stereotype is rendered as a name enclosed by guillemets (French quotation marks of the form « »), placed above the name of another element.tagged value is a property of a stereotype, allowing you to create new information in an element bearing that stereotype. Graphically, a tagged value is rendered as a string of the form name = value within a note attached to the object.constraint is a textual specification of the semantics of a UML element, allowing you to add new rules or to modify existing ones. Graphically, a constraint is rendered as a string enclosed by brackets and placed near the associated element or connected to that element or elements by dependency relationships. As an alternative, you can render a constraint in a note.
Notes
A note that renders a comment has no semantic impact, meaning that its contents do not alter the meaning of the model to which it is attached. This is why notes are used to specify things like requirements, observations, reviews, and explanations, in addition to rendering constraints.A note may contain any combination of text or graphics. If your implementation allows it, you can put a live URL inside a note, or even link to or embed another document. In this way, you can use the UML to organize all the artifacts you might generate or use during development, as Figure 6-3 illustrates.
Figure 6-3. Notes

Notes may be attached to more than one element by using dependencies, as discussed in Chapter 5 . |
Other Adornments
Adornments are textual or graphical items that are added to an element's basic notation and are used to visualize details from the element's specification. For example, the basic notation for an association is a line, but this may be adorned with such details as the role and multiplicity of each end. In using the UML, the general rule to follow is this: Start with the basic notation for each element and then add other adornments only as they are necessary to convey specific information that is important to your model.
The basic notation for an association, along with some of its adornments, are discussed in Chapters 5 and 10 . |
Figure 6-4. Extra Compartments

Stereotypes
The UML provides a language for structural things, behavioral things, grouping things, and notational things. These four basic kinds of things address the overwhelming majority of the systems you'll need to model. However, sometimes you'll want to introduce new things that speak the vocabulary of your domain and look like primitive building blocks.
These four basic elements of the UML are discussed in Chapter 2 . |
The Rational Unified Process is summarized in Appendix B . |
Figure 6-5. Stereotypes

Tagged Values
Every thing in the UML has its own set of properties: classes have names, attributes, and operations; associations have names and two or more ends, each with its own properties; and so on. With stereotypes, you can add new things to the UML; with tagged values, you can add new properties to a stereotype.You define tags that apply to individual stereotypes so that everything with that stereotype has that tagged value. A tagged value is not the same as a class attribute. Rather, you can think of a tagged value as metadata because its value applies to the element specification, not to its instances. For example, as Figure 6-6 shows, you can specify the required capacity of a server class or require that only one kind of server be used in a given system.
Figure 6-6. Stereotype and Tag Definitions

Attributes are discussed in Chapters 4 and 9 . |
Figure 6-7. Tagged Values

Constraints
Everything in the UML has its own semantics. Generalization (usually, if you know what's good for you) implies the Liskov substitution principle, and multiple associations connected to one class denote distinct relationships. With constraints, you can add new semantics or extend existing rules. A constraint specifies conditions that a run-time configuration must satisfy to conform to the model. For example, as Figure 6-8 shows, you might want to specify that, across a given association, communication is secure; a configuration that violates this constraint is inconsistent with the model. Similarly, you might want to specify that among a set of associations connected to a given class, a particular instance may have links of only one association in the set.
Figure 6-8. Constraint

Time and space constraints, commonly used when modeling real time systems, are discussed in Chapter 24 . |
Constraints may be attached to more than one element by using dependencies, as discussed in Chapter 5 . |
Standard Elements
The UML defines a number of standard stereotypes for classifiers, components, relationships, and other modeling elements. There is one standard stereotype, mainly of interest to tool builders, that lets you model stereotypes themselves.
Classifiers are discussed in Chapter 9 . |
• stereotype | Specifies that the classifier is a stereotype that may be applied to other elements |
Profiles
Often it is useful to define a version of UML tailored to a particular purpose or domain area. For example, if you want to use a UML model for code generation in a particular language, it is helpful to define stereotypes that can be applied to elements to give hints to the code generator (like an Ada pragma). The stereotypes you define would be different for Java and C++, however. As another example, you might want to use UML for modeling databases. Some of the UML capabilities, such as dynamic modeling, are less important, but you want to add concepts such as candidate keys and indexes. You can tailor UML using profiles.A profile is a UML model with a set of predefined stereotypes, tagged values, constraints, and base classes. It also selects a subset of the UML element kinds for use so that a modeler is not confused by element kinds that are not needed for the particular application area. A profile defines, in effect, a specialized version of UML for a particular area. Because it is built on ordinary UML elements, it does not represent a new language, and it can be supported by ordinary UML tools.Most modelers will not construct their own profiles. Most profiles will be constructed by tool builders, framework builders, and similar designers of generic capabilities. Many modelers will use profiles, however. It is the same as traditional subroutine libraries-a few experts built them but many programmers used them. We expect profiles to be constructed for programming languages and databases, for different implementation platforms, for different modeling tools, and for various business domain application areas.