5.2 Attributes


Definition: An attribute is the abstraction of a single characteristic possessed by all the entities that were, themselves, abstracted as a class.

The goal is to obtain a set of attributes for a class that is:

  • Complete They capture all information about the class.

  • Fully factored Each attribute captures a separate aspect of the class abstraction.

  • Mutually independent The attributes take on values independently of one another.

5.2.1 Finding Attributes

For each class, start out by asking yourself, "What characteristics do all the things in the domain possess (that we care about)?" Another approach is to go back to the abstraction and ask, "What information is inherent to this abstraction that makes the abstraction what it is?"

Attributes fall into three informal categories: descriptive, naming, and referential. These categories are offered only as a way to ease finding attributes for classes.

A descriptive attribute is an attribute that describes an intrinsic characteristic of the thing, such as the amount of the order, or the customer's address. These attributes can be found by considering what describes each thing.

A naming attribute is an arbitrary name or label used to refer to a thing. You can change the names or labels of each thing without changing what it is: That is, if we re-number an airplane, it is still the same airplane. Naming attributes help identify things from outside the domain. (Inside the domain, we have object references.)

A referential attribute provides facts about links. For example, an Order may have a customer attribute that refers to the Customer who made the order. Referential attributes formalize associations (e.g., "the Order's Customer"), a topic we address in Chapter 6: Relationships and Associations.



Executable UML. A Foundation for Model-Driven Architecture
Executable UML: A Foundation for Model-Driven Architecture
ISBN: 0201748045
EAN: 2147483647
Year: 2001
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net