You are on page 1of 7

LOVELY PROFESSIONAL UNIVERSITY

Mittal School of Business (MSOB). Faculty: Sandeep Gautam


Course Code: CAP382. Section: Q1915
Date of Submission: 16th February 2021

Basis of UML diagram

Bachelor of Business Administration

(Information Technology)

LOVELY PROFESSIONAL UNIVERSITY

PHAGWARA, PUNJAB

Submitted By :

Name of student: Shivam Tripathi

Registration Number: 11900954

Roll no. 33
Q 1) Make a state diagram of ATM machine by using Events, State
transaction and sequence?

Ans .

Bank ATM
UML State Machine Diagram Example
This is an example of UML behavioural machine diagram showing Bank
Automated Teller Machine (ATM) top level state machine.ATM is initially
turned off. After the power is turned on, ATM performs startup action and
enters Self test state. If the test fails, ATM goes into Out of Service state,
otherwise there is triggerless transition to the Idle state. In this state ATM
waits for customer interaction.The ATM state changes from Idle to Serving
Customer when the customer inserts banking or credit card in the ATM's
card reader. On entering the Serving Customer state, the entry
action readCard is performed. Note, that transition from Serving
Customer state back to the Idle state could be triggered by cancel event as
the customer could cancel transaction at any time.

Serving Customer state is a composite state with sequential


substates Customer Authentication, Selecting Transaction and Transaction.
Customer Authentication and Transaction are composite states by
themselves which is shown with hidden decomposition indicator
icon. Serving Customer state has triggerless transition back to the Idle state
after transaction is finished. The state also has exit action eject Card which
releases customer's card on leaving the state, no matter what caused the
transition out of the state.

Q 2) Create a use case diagram for student database.


Ans.

Q 3) What is Class Diagram? How to show Relationships,


Generalization, Associations and Aggregations in class diagram?
Give appropriate example.
Ans.

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.
Class diagram describes the attributes and operations of a class and also the
constraints imposed on the system. The class diagrams are widely used in
the modeling of objectoriented systems because they are the only UML
diagrams, which can be mapped directly with object-oriented languages.
Class diagram shows a collection of classes, interfaces, associations,
collaborations, and constraints. It is also known as a structural diagram.

In the example, a class called “loan account” is depicted. Classes in class


diagrams are represented by boxes that are partitioned into three:
1. The top partition contains the name of the class.
2. The middle part contains the class’s attributes.
3. The bottom partition shows the possible operations that are associated
with the class.

The example shows how a class can encapsulate all the relevant data of a
particular object in a very systematic and clear way. A class diagram is a
collection of classes similar to the one above.

Relationships in Class Diagrams


Classes are interrelated to each other in specific ways. In particular,
relationships in class diagrams include different types of logical
connections. The following are such types of logical connections that
are possible in UML:

• Association
• Directed Association
• Reflexive Association
• Aggregation
• Generalization
• Association

Association

is a broad term that encompasses just about any logical connection or


relationship between classes. For example, passenger and airline may
be linked as above:

Directed Association

Directed Association

refers to a directional relationship represented by a line with an


arrowhead. The arrowhead depicts a container-contained directional
flow.

Reflexive Association

Reflexive Association
This occurs when a class may have multiple functions or
responsibilities. For example, a staff member working in an airport may
be a pilot, aviation engineer, a ticket dispatcher, a guard, or a
maintenance crew member. If the maintenance crew member is
managed by the aviation engineer there could be a managed by
relationship in two instances of the same class.

Aggregation

Aggregation

refers to the formation of a particular class as a result of one class being


aggregated or built as a collection. For example, the class “library” is
made up of one or more books, among other materials. In aggregation,
the contained classes are not strongly dependent on the lifecycle of the
container. In the same example, books will remain so even when the
library is dissolved. To show aggregation in a diagram, draw a line from
the parent class to the child class with a diamond shape near the parent
class.

To show aggregation in a diagram, draw a line from the parent class to


the child class with a diamond shape near the parent class.
Generalization

Inheritance

refers to a type of relationship wherein one associated class is a child of


another by virtue of assuming the same functionalities of the parent
class. In other words, the child class is a specific type of the parent
class. To show inheritance in a UML diagram, a solid line from the child
class to the parent class is drawn using an unfilled arrowhead.

You might also like