Experiment No 5: Aim: Develop UML Case and Class Diagram For Project
Experiment No 5: Aim: Develop UML Case and Class Diagram For Project
Theory:
Use Case Diagram:
In the Unified Modelling Language (UML), a use case diagram can summarize the details of your
system's users (also known as actors) and their interactions with the system. To build one, you'll use a set
of specialized symbols and connectors. An effective use case diagram can help your team discuss and
represent:
•Scenarios in which your system or application interacts with people, organizations, or external
systems
•Goals that your system or application helps those entities (known as actors) achieve
•The scope of your system
UML use case diagrams are ideal for:
• Representing the goals of system-user interactions
• Defining and organizing functional requirements in a system
• Specifying the context and requirements of a system
Modelling the basic flow of events in a use case Relationships
A model is not complete unless the relationships between elements are described properly. The
Relationship gives a proper meaning to a UML model.
1. Dependency Notation
Dependency is an important aspect in UML elements. It describes the dependent elements and the
direction of dependency. Dependency is represented by a dotted arrow as shown in the following figure.
The arrow head represents the independent element and the other end represents the dependent element.
Dependency is used to represent dependency between two elements of a system
2. Association Notation
Association describes how the elements in a UML diagram are associated. In simple words, it describes
how many elements are taking part in an interaction. Association is represented by a dotted line with
(without) arrows on both sides. The two ends represent two associated elements as shown in the
following figure. The multiplicity is also mentioned at the ends (1, *, etc.) to show how many objects are
associated.
4. Extensibility Notation
All the languages (programming or modelling) have some mechanism to extend its capabilities such as
syntax, semantics, etc. UML also has the following mechanisms to provide extensibility features.
Actor specifies a role played by a user or any other system that interacts with the object.
Use case is a list of steps, typically defining interactions between an actor and a system, to achieve a goal.
Package is used to group elements, and to provide a namespace for the grouped elements.
Constraint is an extension mechanism that enables you to refine the semantics of a UML model element.
CLASS DIAGRAM:
Class Diagram gives the static view of an application. A class diagram describes the types of objects in
the system and the different types of relationships that exist among them. This modelling method can run
with almost all Object-Oriented Methods.
Class Name
The name of the class is only needed in the graphical representation of the class. It appears in the topmost
compartment. A class is the blueprint of an object which can share the same relationships, attributes,
operations, & semantics. The class is rendered as a rectangle, including its name, attributes, and
operations in sperate compartments.
Attributes:An attribute is named property of a class which describes the object being modelled. In the
class diagram, this component is placed just below the name-compartment.
A derived attribute is computed from other attributes. For example, an age of the student can be easily
computed from his/her birth date.
Relationships
Dependency
A dependency means the relation between two or more classes in which a change in one may force
changes in the other. However, it will always create a weaker relationship. Dependency indicates that one
class depends on another.
Generalization:
A generalization helps to connect a subclass to its superclass. A sub-class is inherited from its superclass.
Generalization relationship can't be used to model interface implementation. Class diagram allows
inheriting from multiple super classes.
Association:
This kind of relationship represents static relationships between classes A and B. For example; an
employee works for an organization.
In this example, the relationship between student and college is shown which is studies.
Multiplicity
A multiplicity specifies whether the association is mandatory or not. It has some lower bound and upper
bound.
Let's say that that there are 100 students in one college. The college can have multiple students.
Aggregation
Aggregation is a special type of association that models a whole- part relationship between aggregate and
available. Composition:
The composition is a special type of aggregation which denotes strong ownership between two classes
when one class is a part of another class.
Conclusion: