Ooad Answer Key
Ooad Answer Key
Ooad Answer Key
Use Case
A use case represents a function or an action within the system. It’s drawn as an oval and named with
the function.
System
The system is used to define the scope of the use case and drawn as a rectangle. This an optional
element but useful when you’re visualizing large systems. For example, you can create all the use cases
and then use the system object to define the scope covered by your project. Or you can even use it to
show the different areas covered in different releases.
Package
The package is another optional element that is extremely useful in complex diagrams
A use case with most of the scenarios found in use case diagrams
(OR)
b. i. (i) Describe the UML notation for class diagram with example.(8)
UML - Class Diagram
Class diagram is a static diagram. It represents the static view of an application. Class diagram is not only
used for visualizing, describing, and documenting different aspects of a system but also for constructing
executable code of the software application.
Purpose of Class Diagrams
The purpose of class diagram is to model the static view of an application. Class diagrams are the only
diagrams which can be directly mapped with object-oriented languages and thus widely used at the time
of construction.
UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the
application, however class diagram is a bit different. It is the most popular UML diagram in the coder
community.
The purpose of the class diagram can be summarized as −
Analysis and design of the static view of an application.
Describe responsibilities of a system.
Base for component and deployment diagrams.
Forward and reverse engineering.
How to Draw a Class Diagram?
Class diagrams are the most popular UML diagrams used for construction of software applications. It is
very important to learn the drawing procedure of class diagram.
Class diagrams have a lot of properties to consider while drawing but here the diagram will be considered
from a top level view.
The name of the class diagram should be meaningful to describe the aspect of the system.
Each element and their relationships should be identified in advance.
Responsibility (attributes and methods) of each class should be clearly identified
For each class, minimum number of properties should be specified, as unnecessary properties will make
the diagram complicated.
Use notes whenever required to describe some aspect of the diagram. At the end of the drawing it should
First of all, Order and Customer are identified as the two elements of the system. They have a one-to-
many relationship because a customer can have multiple orders.
Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and
NormalOrder.
Link
A link represents a connection through which an object collaborates with other objects. Rumbaugh has
defined it as “a physical or conceptual connection between objects”. Through a link, one object may
invoke the methods or navigate through another object. A link depicts the relationship between two or
more objects.
Association
Association is a group of links having common structure and common behavior. Association depicts the
relationship between objects of one or more classes. A link can be defined as an instance of an
association.
Degree of an Association
Degree of an association denotes the number of classes involved in a connection. Degree may be unary,
binary, or ternary.
A unary relationship connects objects of the same class.
A binary relationship connects objects of two classes.
A ternary relationship connects objects of three or more classes.
Cardinality Ratios of Associations
Cardinality of a binary association denotes the number of instances participating in an association. There
are three types of cardinality ratios, namely −
One–to–One − A single object of class A is associated with a single object of class B.
One–to–Many − A single object of class A is associated with many objects of class B.
Many–to–Many − An object of class A may be associated with many objects of class B and conversely
an object of class B may be associated with many objects of class A.