Standards: Attributes
- Analysis
|
An attribute is a named property of a class that describes a range of values that
instances of the property may hold. |
Related Information: |
|
Topics
Background
The set of Types that can be used to define attributes (properties) in the analysis
model needs to be defined. The decision whether to define attributes (implying getters and
setters) or to define getters (implying the need for an attribute) in the analysis model,
to indicate knowledge, must be taken.
Given the conceptual nature of the analysis model and its implementation independence
we may need to define the set of value, or primitive types, that we are to use within the
analysis model. We may decide to use the implementation languages primitive types or the
set of user defined value types defined for use during design or a specialized set of
analysis value types.
To facilitate the identification of object attributes, all knowledge will be
modeled as attributes, and / or relationships.
In the value types section below is an illustrative set of value types for use during
analysis it is important to remember that this set can be overridden, customized or
that the design set of value types can be used instead.
Analysis Value Types
Value
Type |
Description |
Number |
Any numeric value. Used to represent a
positive or negative number. The number may have a fractional part. |
Integer |
The set of integers, including 0. Used to
represent a positive or negative whole number. |
String |
Alphanumeric data. Used to represent any
information held as textual strings. |
Date |
Any date. |
Time |
Any time. |
DateTime |
Any moment specified by a date and a time. |
Character |
Any character. |
Boolean |
Used for true / false attribute assignments. |
Note: Rose98i comes with a set of fundamental types designed for use in the analysis
space:
Value
Type |
Description |
Boolean |
|
Byte |
|
Currency |
|
Date |
|
Double |
|
Integer |
|
Long |
|
Object |
|
Single |
|
String |
|
Variant |
|
Which looks remarkably like the set of VB primitive types to me and not particularly
applicable as a set of Analysis value types. Object, Single and Variant seem
especially suspect to me.
Note: To implement the set of Analysis value types outlined above a new Rose Add In
would need to be developed (called say RUP Analysis). This could then be updated as the
need for additional analysis value types is identified. This is currently under
investigation by the author.
Naming Standards
The general attribute naming standards apply during analysis (See Standards: Attributes - General)
General Documentation Standards
The general attribute documentation standards apply during design (See Standards: Attributes - General).
During the analysis activities each attribute must be assigned a type from the set of
analysis value types (see Value Types above).
There is no need to define whether attributes are derived or not in the analysis model
this is a design decision.
All attributes discovered during analysis are assumed to support full public access.
Decisions about read only attributes will be made during design. Note: the
attributes themselves will be private, it is their access that is assumed to be public.
When defining the attributes during analysis the most important thing is to
characterize the attribute and its responsibilities. This will enable the designer
to choose the correct implementation for the attribute and to assess its impact on the
other design mechanisms required by the class.
For details of how to document attributes in Rose see Standards:
Attributes in Rose.
Stereotypes
No analysis stereotypes have been identified for attributes.
Examples
None |