Previous UML Classes Table of Contents UML Packages Next

17.4.3 String

PrimitiveType s

   A string is a sequence of characters in some suitable character set used to display information about the model. Character sets may include non-Roman alphabets and characters.




   An instance of String defines a piece of text. The semantics of the string itself depends on its purpose, it can be a comment, computational language expression, OCL expression, etc. It is used for String attributes and String expressions in the metamodel.


   No additional attributes


   No additional associations


   No additional constraints


   String is an instance of PrimitiveType .


   String appears as the type of attributes in the metamodel. String instances are values associated to slots. The value is a sequence of characters surrounded by double quotes ("). It is assumed that the underlying character set is sufficient for representing multibyte characters in various human languages; in particular, the traditional 8-bit ASCII character set is insufficient. It is assumed that tools and computers manipulate and store strings correctly, including escape conventions for special characters, and this document will assume that arbitrary strings can be used.

   A string is displayed as a text string graphic. Normal printable characters should be displayed directly. The display of nonprintable characters is unspecified and platform-dependent.


   Figure 17.14 -An example of a string attribute