0% found this document useful (0 votes)
16 views17 pages

Object Daigram

The document discusses class diagrams, object diagrams, values and attributes, operations and methods, and provides examples of class diagrams and object diagrams. It also includes exercises for the reader to practice creating class diagrams and object diagrams.

Uploaded by

papatel4045
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views17 pages

Object Daigram

The document discusses class diagrams, object diagrams, values and attributes, operations and methods, and provides examples of class diagrams and object diagrams. It also includes exercises for the reader to practice creating class diagrams and object diagrams.

Uploaded by

papatel4045
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

The Static Structure Diagrams

UNIT-5
Class diagrams
• Class diagrams provide a graphic notation for
modeling classes and their relationships,
thereby describing possible objects.
• Class diagrams are useful both for abstract
modeling and for designing actual programs.
• They are concise, easy to understand, and
work well in practice.
Object diagram
• An object diagram shows individual objects
and their relationships.
• Object diagrams are helpful for documenting
test cases and discussing examples.
• A class diagram corresponds to an infinite set
of object diagrams.
Values and Attributes
• A value is a piece of data
• An attribute is a named property of a class that
describes a value held by each object of the class.
• Name, birthdate, and weight are attributes of
Person objects. Color, modelYear, and weight are
attributes of Car objects.
• Each attribute has a value for each object. For
example, attribute birthdate has value “21
October 1983” for object JoeSmith.
Example
Operations and Methods
• An operation is a function or procedure that may
be applied to or by objects in a class. Hire, fire,
and payDividend are operations on class
Company. Open, close, hide, and redisplay are
operations on class Window.
• All objects in a class share the same operations
Class and object diagram
Class and object diagram
Exercise
Solution
Prepare a class diagram from the
object diagram
Solution
Question:
• Figure is a partially completed class diagram of
an air transportation system. Multiplicity has
been omitted. Add multiplicity and association
to the diagram. Demonstrate how multiplicity
decisions depend on your perception of the
world.
Solution
Question
• Prepare a class diagram for each group of classes. Add at
least 10 relationships (associations and generalizations) to
each diagram. Use association names and association end
names where needed. Also use qualified associations and
show multiplicity. You do not need to show attributes or
operations. As you prepare the diagrams, you may add
classes. Be sure to explain your diagrams.
• a. school, playground, principal, school board, classroom,
book, student, teacher, cafeteria, restroom, computer,
desk, chair, ruler, door, swing.
• B. file system, file, ASCII file, binary file, directory file, disc,
drive, track, sector

You might also like