Information Technology Reference
In-Depth Information
are received. An instance variable (i.e., attribute) could be either a noncomposite
instance variable or a composite variable. Noncomposite instance variables are di-
vided further into simple instance variables and complex instance variables. Simple
instance variables take individual objects as their values. An individual object could
be a basic system object such as integer, string, or Boolean, or a user defined object.
Complex instance variables (i.e., complex objects) take a set or a list of individual
objects as their values. For example, a complex instance variable HOBBY can have
multiple values (SWIMMING, TENNIS, MUSIC).
Any class that has a composite instance variable is a composite class. The in-
stances belonging to such a class are composite objects. A composite object together
with its components forms an IS-PART-OF hierarchy. The link from a composite
object to its component is called a composite link. For example, a composite class
CAR can have attributes (BODY, ENGINE, TIER) and each one of them is a class
itself.
A second hierarchy that may be formed is the ISA hierarchy, where subclasses
are associated with a class. The subclasses inherit all the methods and instance
variables defined for the class. A subclass could also have some additional instance
variables and methods. For example, a subclass GRADUATE_STUDENT can in-
herit all the attributes and methods of its superclass STUDENT.
An object-oriented data model has the following properties:
• Anobjectisaninstancevalueofaclass.Aclasscanhavemanyinstances.Aclass
has attributes and methods. The attributes of a class describe its properties. The
methods of a class describe its operations.
• Aclassmustsupportencapsulation(i.e., hiding operations from the users) such
that
object = data + program
data = values of attributes
program = methods that operates on the state
• Objectattributescanbeeithersimpleorcomplex.Thevalueofacomplexattri-
bute is a reference to the instance of another class. In other words, an object can
be a nested object such that the value of an object is another object.
• Polymorphismallows a program entity to refer at run-time to instances of a va-
riety of types.
• Objectattributescanbesingle-valuedormulti-valued.
• ObjectsareuniquelyidentifiedbyOIDthat are assigned by the system.
• Inaclasshierarchy,asubclassinheritsattributesandmethodsfromoneormore
superclasses.
An example of a class Department and a class Instructor is shown below:
Search WWH ::




Custom Search