Standards: Attributes
- General
Topics
Introduction
In this section we outline the standards that are applicable to attributes at all
times.
The standards applicable to attributes can vary dependent upon the stage of analysis or
design being undertaken. For more details on the specific standards see:
Standards: Attributes - Analysis
Standards: Attributes - Design
For information on documenting attributes in Rational Rose see:
Standards: Attributes in Rose
Background
An attribute represents some property of the thing you are modeling that is declared
for all instances of the class. At a given moment in time, an object of a class will
have specific values for every one of its class's attributes.
Attributes implicitly have value semantics that is they have no identity
separate from their value and are therefore immutable.
Value types are often provided by a programming environment as built in data, or
primitive, types (such as int or char). This neednt always be the case, though: a
library supplied or programmer defined class can also implement value semantics.
Deciding whether a type is a value type, or object type, depends on the context: for
example, a type such as Currency could be either.
The base set of Value Types available to the modeler for use during analysis and
design are defined by the standards Standards: Attributes - Analysis
and Standards: Attributes - Design.
Naming Standards
Attributes names should be a noun that clearly states what information the attribute
holds. The attribute name is a noun that describes the attribute's role in relation
to the object.
Begin attribute names with a lower case letter. Attribute names should not
contain spaces, underscores or special characters. You capitalize the first letter
of every word in an attribute name except for the first letter i.e. dateOfBirth. Do not prefix attribute names with
m_.
Do not repeat the name of the containing class in the name of the attribute (i.e. if
the class Student has an attribute identifier this
should be called identifier and not studentIdentifier).
General Documentation Standards
Each attribute must have its description completed. Where necessary this should
complement the name by further describing the attribute's purpose from a business
perspective.
Each attribute should be characterized by detailing the following characteristics:
Initial value: The value of the attribute on object creation.
Help text id: The value of the help text for the field.
Valid ranges: Details of any range limitations applied to the attribute
Formatting details: Details of any formatting rules applied to the value of the
attribute.
Validation rules: Details of any validation rules that should be applied to the
attributes values.
Invariants: Details of any invariant conditions that apply to the attribute.
where these are not already identified by the attributes type. These details should be
contained in the documentation field on "General" tab of the attribute's
specification.
Stereotypes
No stereotypes have been identified for attributes.
TO SET AN ATTRIBUTE AS STATIC, EITHER SET THE STATIC ATTRIBUTE ON
THE DETAIL PAGE FOR THE ATTRIBUTE OR APPEND A $ TO THE FRONT OF THE NAME.
Examples
None
|