![]() |
subject > programming language construct > data item > variable > attribute |
![]() ![]() | ||||
attribute | ||||
subject | fact |
attribute | can be identified by looking at the description of the system and searching for information that must be maintained about each class | ![]() |
has definition A simple data item present in all the instances of a class | ![]() | |
is a subtopic of 9.2 - Principles Leading to Good Design | ![]() | |
is implemented as an instance variable in Java | ![]() | |
is used in the analysis and design stage before it is known how the attribute will be implemented | ![]() | |
is a kind of data abstraction | ![]() | |
is a kind of variable | ![]() | |
must not be added to a model unless it is relevant to the application - it will be needed to implement some requirement | ![]() | |
must not have a plural name | ![]() | |
represents the properties of an object | ![]() | |
should be a simple variable - typically an integer or string, or a one-to-one composition | ![]() | |
should be private | ![]() | |
should not have an implicit internal structure | ![]() | |
should not normally represent a variable number of things | ![]() | |
should only be accessed through public methods so that attributes are only given valid values and so that you can change the internal design of the class without affecting how users of the class interact with it | ![]() | |
data abstraction | groups the pieces of data that describe some entity, so that programmers can manipulate that data as a unit | ![]() |
helps a programmer to cope with the complexity of data | ![]() | |
hides the details of data | ![]() | |
variable | can contain different classes of objects depending on the type of the variable | ![]() |
can refer to a particular object, several different objects during the execution of a program, or no object at all | ![]() | |
has scope | ![]() | |
has type | ![]() |
Next data abstraction: class Up: data abstraction, variable Previous data abstraction: association