You are on page 1of 16

Software Engineering 421_Karan Gada SY.Bsc.

IT

Practical 1
Aim: Study and implementation of use case diagram.
Description:
 A use diagram is a graphic depiction of the interactions among the elements of a
system.
 A use case is a methodology used in system analysis to identify, clarify and organize
system requirements.
 The actors, usually individual involved with the system defined according to their
roles.
Components:
Actor:
 A role that a user plays with respect to the system, including human users and other
systems. 
 e.g. inanimate physical objects (e.g. robot); an external system that needs some
information from the current system.
 Stick figures that represent the people actually employing the use cases.

Use Case:
 A set of scenarios that describing an interaction between a user and a system,
including alternatives. Use cases are used to represent high-level functionalities and
how the user will handle the system.

System Boundary:

 A Rectangle diagram representing the boundary between the actors and the system.
A box that sets a system scope to use cases. All use cases outside the box would be
considered outside the scope of that system.
 Association:
 An association is a connection (communication) between an actor and a use case. In
complex diagrams, it is important to know which actors are associated with which use
cases. Represented by a solid line.
Software Engineering 421_Karan Gada SY.Bsc.IT

Generalization: 
 Relationship between one general use case and a special use case (used for defining
special alternatives). Represented by a line with a triangular arrow head toward the
parent use case.

Include:
 A dotted line labeled <<include>> beginning at base use case and ending with an
arrows pointing to the include use case. The include relationship occurs when a chunk
of behavior is similar across more than one use case. Use “include” instead of copying
the description of that behavior.

Extend:
 A dotted line labeled <<extend>> with an arrow toward the base case. The extending
use case may add behavior to the base use case. The base class declares “extension
points”.

Solution: A Use case diagram of ATM Machine System.


Diagram:
Software Engineering 421_Karan Gada SY.Bsc.IT

Use Case Diagram of Library Management System:


Software Engineering 421_Karan Gada SY.Bsc.IT

Practical 2
Aim: Study and Application of Class Diagram for ATM Machine.
Description:
What is class diagram?
In software engineering, a class diagram in the Unified Modeling Language (UML) is a type
of static structure diagram that describes the structure of a system by showing the system's
classes, their attributes, operations (or methods), and the relationships among objects.

Purpose of class diagram:

1. Shows static structure of classifiers in a system


2. Diagram provides a basic notation for other structure diagrams prescribed by UML
3. Helpful for developers and other team members too
4. Business Analysts can use class diagrams to model systems from a business
perspective

Class Notations:
A class notation consists of three parts:
1. Class Name

The name of the class appears in the first partition.


2. Class Attributes

Attributes are shown in the second partition.


The attribute type is shown after the colon.
Attributes map onto member variables (data members) in code.
3. Class Operations (Methods)

Operations are shown in the third partition. They are services the class provides.
The return type of a method is shown after the colon at the end of the method signature.
The return type of method parameters is shown after the colon following the parameter
name.
Operations map onto class methods in code
 Simple class
Software Engineering 421_Karan Gada SY.Bsc.IT

Class Relationships:
A class may be involved in one or more relationships with other classes. A relationship can
be one of the following types: (Refer to the figure on the right for the graphical representation
of relationships).
 Relationship Type

1. Inheritance (or Generalization):
 Represents an "is-a" relationship.
 An abstract class name is shown in italics.
 SubClass1 and SubClass2 are specializations of Super Class.
 A solid line with a hollow arrowhead that point from the child to the parent class

2. Simple Association:
 A structural link between two peer classes.
 There is an association between Class1 and Class2
 A solid line connecting two classes

3. Aggregation:

A special type of association. It represents a "part of" relationship.


 Class2 is part of Class1.
Software Engineering 421_Karan Gada SY.Bsc.IT

 Many instances (denoted by the *) of Class2 can be associated with Class1.


 Objects of Class1 and Class2 have separate lifetimes.
 A solid line with an unfilled diamond at the association end connected to the class of
composite

4. Composition:

A special type of aggregation where parts are destroyed when the whole is destroyed.
 Objects of Class2 live and die with Class1.
 Class2 cannot stand by itself.
 A solid line with a filled diamond at the association connected to the class of
composite

5. Dependency:

Exists between two classes if the changes to the definition of one may cause changes to the
other (but not the other way around).
 Class1 depends on Class2
 A dashed line with an open arrow

Multiplicity
How many objects of each class take part in the relationships and multiplicity can be
expressed as:
 Exactly one - 1
 Zero or one - 0..1
 Many - 0..* or *
 One or more - 1..*
 Exact Number - e.g. 3..4 or 6
 Or a complex relationship - e.g. 0..1, 3..4, 6.* would mean any number of objects
other than 2 or 5
Software Engineering 421_Karan Gada SY.Bsc.IT

Solution:
Class diagram forATM Machine:

Class diagram for Library Management System:


Software Engineering 421_Karan Gada SY.Bsc.IT
Software Engineering 421_Karan Gada SY.Bsc.IT

Practical 3
Aim: Study the application of ER diagram for Hotel Management.
Description:
ER Model is represented by means of an ER diagram. Any object, for example, entities,
attributes of an entity, relationship sets, and attributes of relationship sets, can be represented
with the help of an ER diagram.

Entity
Entities are represented by means of rectangles. Rectangles are named with the entity set
they represent.

Attributes
Attributes are the properties of entities. Attributes are represented by means of ellipses.
Every ellipse represents one attribute and is directly connected to its entity (rectangle).

If the attributes are composite, they are further divided in a tree like structure. Every node is
then connected to its attribute. That is, composite attributes are represented by ellipses that
are connected with an ellipse.
Software Engineering 421_Karan Gada SY.Bsc.IT

Multivalued attributes are depicted by double ellipse.

Derived attributes are depicted by dashed ellipse.


Software Engineering 421_Karan Gada SY.Bsc.IT

Relationship
Relationships are represented by diamond-shaped box. Name of the relationship is written
inside the diamond-box. All the entities (rectangles) participating in a relationship, are
connected to it by a line.

Binary Relationship and Cardinality


A relationship where two entities are participating is called a binary relationship. Cardinality
is the number of instance of an entity from a relation that can be associated with the relation.
 One-to-one − When only one instance of an entity is associated with the relationship,
it is marked as '1:1'. The following image reflects that only one instance of each entity
should be associated with the relationship. It depicts one-to-one relationship.


One-to-many − When more than one instance of an entity is associated with a
relationship, it is marked as '1:N'. The following image reflects that only one instance
of entity on the left and more than one instance of an entity on the right can be
associated with the relationship. It depicts one-to-many relationship.
Software Engineering 421_Karan Gada SY.Bsc.IT


Many-to-one − When more than one instance of entity is associated with the
relationship, it is marked as 'N:1'. The following image reflects that more than one
instance of an entity on the left and only one instance of an entity on the right can be
associated with the relationship. It depicts many-to-one relationship.


Many-to-many − The following image reflects that more than one instance of an
entity on the left and more than one instance of an entity on the right can be
associated with the relationship. It depicts many-to-many relationship.

Participation Constraints
 Total Participation − Each entity is involved in the relationship. Total participation is
represented by double lines.
 Partial participation − Not all entities are involved in the relationship. Partial
participation is represented by single lines.
Software Engineering 421_Karan Gada SY.Bsc.IT

The ER Model has the power of expressing database entities in a conceptual hierarchical
manner. As the hierarchy goes up, it generalizes the view of entities, and as we go deep in
the hierarchy, it gives us the detail of every entity included.
Going up in this structure is called generalization, where entities are clubbed together to
represent a more generalized view. For example, a particular student named Mira can be
generalized along with all the students. The entity shall be a student, and further, the student
is a person. The reverse is called specialization where a person is a student, and that student
is Mira.

Generalization
As mentioned above, the process of generalizing entities, where the generalized entities
contain the properties of all the generalized entities, is called generalization. In
generalization, a number of entities are brought together into one generalized entity based on
their similar characteristics. For example, pigeon, house sparrow, crow and dove can all be
generalized as Birds.

Specialization
Specialization is the opposite of generalization. In specialization, a group of entities is
divided into sub-groups based on their characteristics. Take a group ‘Person’ for example. A
person has name, date of birth, gender, etc. These properties are common in all persons,
human beings. But in a company, persons can be identified as employee, employer,
customer, or vendor, based on what role they play in the company.

Similarly, in a school database, persons can be specialized as teacher, student, or a staff,


based on what role they play in school as entities.
Software Engineering 421_Karan Gada SY.Bsc.IT

Inheritance
We use all the above features of ER-Model in order to create classes of objects in object-
oriented programming. The details of entities are generally hidden from the user; this
process known as abstraction.
Inheritance is an important feature of Generalization and Specialization. It allows lower-
level entities to inherit the attributes of higher-level entities.

For example, the attributes of a Person class such as name, age, and gender can be inherited
by lower-level entities such as Student or Teacher.
 
Solution:
ER diagram for Hotel Management:
Software Engineering 421_Karan Gada SY.Bsc.IT

ER diagram for Order Management System:


Software Engineering 421_Karan Gada SY.Bsc.IT

Practical 4
Aim:

You might also like