Objects
Last updated
Was this helpful?
Last updated
Was this helpful?
Objects are the primary entity in an object diagram. Note these are not classes. Classes belong in .
Objects are declared using the keyword "object" followed by the name of the object.
name - the name in the header of the object
alias - an alias for an object with a long name
stereotype - a stereotype in the header of the object
fill_color - the color of the object
body - the lower portion of the class, contains fields
Note: if you use the string method you must assign an alias to the object.
The alias is exactly that. It is a variable that represents an object. The variable for the alias follows the as keyword.
Note: if you use an alias the name must be inside of quotation marks.
The stereotype field is defined by text between a double set of greater than and less than signs. This adds a stereotype above the object name. This field can be a string without quotations. It supports creole for emphasis.
The fill_color property determines the fill color of the drawn object. The fill_color is defined by a standard color name or hex code. Create a gradient by using two colors. This property must come after a hash (#) sign and touch the hash sign.
There are two ways to add fields to the body of an object. One is by listing the field inside the body of the object when the object is created. The other is by assigning the field to the object by using the object name or alias. Quotation marks are not required for multi-word fields.
You can format fields with creole syntax for emphasis and markup language for color and emphasis. You can define colors with a standard color name or hex code.
The map table or associative array is a special type of object that holds a table or array in the body. It contains all of the same properties as a standard object. The only difference is the structure of the fields or cells.
Cells work similar to fields but they have an arrow in the middle of them. The arrow separates the line into two cells in the map table. Cells also support creole and markup like fields. When formatting cell text, treat each side of the arrow separately.
The name is text that appears in the head of the object. The name can be a single word without quotation marks or it can be a string with quotation marks. The string method supports emphasis with creole and markup language. The string method also supports colors with markup language. You can define colors with a standard color name or hex code. See for a list of creole and markup options.
The body of the object displays the fields that belong to the object. will be discussed later in this chapter.