Object Oriented Software Engineering   View all facts   Glossary   Help
subject > programming language construct > data item > variable
Next data itemobject    Updata item

variable comparison table
Subject declare by have be cause add to access through is a synonym of is a subtopic of implement overuse group hide have purpose use in access by use has definition help represent use by implement as share by identify by contain
attribute an implicit internal structureprivate a model unless it is relevant to the application - it will be needed to implement some requirementpublic 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 9.2 - Principles Leading to Good Design  the pieces of data that describe some entity, so that programmers can manipulate that data as a unitthe details of data the analysis and design stage before it is known how the attribute will be implemented  A simple data item present in all the instances of a classa programmer to cope with the complexity of dataa variable number of things an instance variable in Java looking at the description of the system and searching for information that must be maintained about each classdifferent classes of objects depending on the type of the variable
class variable a value that is shared by all instances of a class    static variableThe Basics of Java    storing:
  • Default or 'constant' values that are widely used by methods in a class
  • Lookup tables and similar structures used by algorithms inside a particular class
   A data item present in a class that is shared by all instances of that class    all instances of the class different classes of objects depending on the type of the variable
global variable comment if it is non-obvious common coupling   9.2 - Principles Leading to Good Design     older programming languages  A variable that is accessible from all procedures in the system, or in the scope of just a specific set of modules (e.g. a Java package).      different classes of objects depending on the type of the variable
instance variable comment if it is non-obviousas private as reasonably possible - almost never make them public   field2.3 - Instance Variablesan attribute or association       A data item present in all the instances of a class, normally used to implement associations and attributes      different classes of objects depending on the type of the variable
Java variablegiving the data type followed by the name of the variablean interface as its type which means that, with the variable, you can invoke any operation supported by the interfaceas private as possible    The Basics of Java      other variables and methods in any class in the same package by default        different classes of objects depending on the type of the variable
reference comment if it is non-obvious     2.3 - Instance Variables        A variable that refers to an object      different classes of objects depending on the type of the variable
variable declared as a non-primitive data type comment if it is non-obvious     The Basics of Java       the name of a class as their type   calling methods or accessing the object's instance variables   an instance of a class
variable declared as primitive data type comment if it is non-obvious     The Basics of Java               object in the sense that its contents is not an instance of any class

Next data itemobject    Updata item