OOM USING UML - Student - Notes
OOM USING UML - Student - Notes
Content of module II
I. UML overview
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
Software Engineering – Level II
Although UML is generally used to model software systems, it is not limited within this boundary.
It is also used to model non-software systems as well. For example, the process flow in a
manufacturing unit, etc.
Like any other language, UML has its own syntax (symbols and sentence formation rules) and
semantics (meanings of symbols and sentences)
However UML is not a programming language but tools can be used to generate code in
various languages using UML diagrams. UML has a direct relation with object oriented analysis
and design. After some standardization, UML has become an OMG standard.
There are a number of goals for developing UML but the most important is to define some general
purpose modeling language, which all modelers can use and it also needs to be made simple to
understand and use.
UML diagrams are not only made for developers but also for business users, common
people, and anybody interested to understand the system. The system can be a software or
nonsoftware system. Thus it must be clear that UML is not a development method rather it
accompanies with processes to make it a successful system. In conclusion, the goal of UML can
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
Software Engineering – Level II
be defined as a simple modeling mechanism to model all possible practical systems in today’s
complex environment.
Hence, the relation between OO design and UML is very important to understand. The OO design
is transformed into UML diagrams according to the requirement. Before understanding the
UML in detail, the OO concept should be learned properly. Once the OO analysis and design is
done, the next step is very easy. The input from OO analysis and design is the input to UML
diagrams.
• Model
A model captures aspects important for some application while omitting (or abstracting) the rest.
A model in the context of software development can be graphical, textual, mathematical, or
program code-based. Models are very useful in documenting the design and analysis results.
Models also facilitate the analysis and design procedures themselves. Graphical models are very
popular because they are easy to understand and construct. UML is primarily a graphical
modeling tool. However, it often requires text explanations to accompany the graphical models.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 3
Software Engineering – Level II
• Conceptual Model
A conceptual model can be defined as a model which is made of concepts and their relationships.
It is the first step before drawing a UML diagram. Conceptual model helps to understand the
entities in the real world and how they interact with each other.
• Static (or structural) view: This view emphasizes the static structure of the system using
objects, attributes, operations, and relationships. Ex: Class diagram, Composite Structure
diagram.
• Dynamic (or behavioral) view: This view emphasizes the dynamic behavior of the system
by showing collaborations among objects and changes to the internal states of objects. Ex:
Sequence diagram, Activity diagram, State Machine diagram.
Architectural model represents the overall framework of the system. It contains both structural
and behavioral elements of the system. Architectural model can be defined as the blueprint of the
entire system. Package diagram comes under architectural modeling.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 4
Software Engineering – Level II
IUGET-DOUALA/2020-2021/Level200/OOM-UML 5
Software Engineering – Level II
(occurrence name)
* *
IUGET-DOUALA/2020-2021/Level200/OOM-UML 6
Software Engineering – Level II
• Aggregation
Aggregation is a special type of association where the involved classes represent a whole-part
relationship. The aggregate takes the responsibility of forwarding messages to the appropriate
parts. Thus, the aggregate takes the responsibility of delegation and leadership. When an instance
of one object contains instances of some other objects, then aggregation (or composition)
relationship exists between the composite object and the component object. Aggregation is
represented by the diamond
• Composition
Composition is a stricter form of aggregation in which the parts are existence-dependent on the
whole. This means that the life of the parts closely ties to the life of the whole. When the whole is
created, the parts are created and when the whole is destroyed, the part s are destroyed. A
typical example of composition is an invoice object with invoice items. As soon as the invoice
IUGET-DOUALA/2020-2021/Level200/OOM-UML 7
Software Engineering – Level II
object is created, all the invoice items in it are created and as soon as the invoice object is
destroyed, all invoice items in it are also destroyed. The composition relationship is represented
as a filled diamond drawn at the composite-end.
2.1.3. Qualifiers
If an association attribute is unique within a set of related objects, then it is a qualifier. A qualifier
is a value that selects a unique object from the set of related objects across an association.
Undetermined multiplicity
Figure 4: Qualifier
Friend of
* child
IUGET-DOUALA/2020-2021/Level200/OOM-UML 8
Software Engineering – Level II
Component diagrams are different in terms of nature and behavior. Component diagrams are used
to model the physical aspects of a system. Now the question is, what are these physical aspects?
Physical aspects are the elements such as executables, libraries, files, documents, etc. which reside
in a node.
Component diagrams are used to visualize the organization and relationships among components
in a system. It describes how a software system is split-up into components and shows the
dependencies among these components. The following diagram is an example of component
diagram.
Order
Entry
« delegate »
IUGET-DOUALA/2020-2021/Level200/OOM-UML 9
Software Engineering – Level II
A deployment diagram consists of nodes. Nodes are nothing but physical hardware used to deploy
the application.
Deployment diagrams are useful for system engineers. An efficient deployment diagram is very
important as it controls the following parameters:
• Performance
• Scalability
• Maintainability
• Portability
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
0
Software Engineering – Level II
Dependency is a relationship
between two entities in
which change in one
element also
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
1
Software Engineering – Level II
These diagrams emphasize what must happen in the system being modeled. Since they illustrate
the behavior of a system, they are used extensively to describe the functionality of software
systems.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
2
Software Engineering – Level II
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
3
Software Engineering – Level II
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
4
Software Engineering – Level II
Following (figure 12) is a sample use case diagram representing the order management system.
Hence, if we look into the diagram then we will find three use cases ( Order, SpecialOrder,
and NormalOrder) and one actor which is the customer.
The SpecialOrder and NormalOrder use cases are extended from Order use case. Hence, they
have extended relationship. Another important point is to identify the system boundary, which
is shown in the picture. The actor Customer lies outside the system as it is an external user of the
system.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
5
Software Engineering – Level II
• Extends
The main idea behind the extends relationship among the use cases is that it allows you to show
optional system behavior. An optional system behavior is extended only under certain conditions.
This relationship among use cases is also predefined as a stereotype “extends”. The extends
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
6
Software Engineering – Level II
relationship is similar to generalization. But unlike generalization, the extending use case can add
additional behavior only at an extension point only when certain conditions are satisfied. The
extension points are points within the use case where variation to the mainline (normal) action
sequence may occur. The extends relationship is normally used to capture alternate paths or
scenarios.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
7
Software Engineering – Level II
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
8
Software Engineering – Level II
Method calls are similar to that of a sequence diagram. However, difference being the
sequence diagram does not describe the object organization, whereas the collaboration
diagram shows the object organization.
Tutorial set I
Exercise: 1
You are required to develop an automated Student Registration System (SRS). This system will
enable students to register online for courses each semester.
1. Provide the specification requirement of SRS
2. Describe all use cases. First of all list high-level use cases, before decomposing each.
3. Model the static or data aspect of the system (Class diagram)
4. Define the sequence diagrams for some specific Add users, Login, Edit profil information
Exercise: 2
The purpose of this exercise is to prepare requirements specification for a software system, then
use those requirement to design the system. You are expected to take into account your own
knowledge of the problem domain in completing this work.
IUGET-DOUALA/2020-2021/Level200/OOM-UML 1
9
Software Engineering – Level II
System description
An n-elevator system is to be installed in a building with m floors. The elevators and the control
mechanism are supplied by the manufacturer. The internal mechanisms of these are assumed
(given).
The problem concerns the logic to move elevators between floors according to the following
constraints:
• Each elevator has a set of buttons, one for each floor. These illuminate when pressed and
cause the elevator to visit the corresponding floor. The illumination is cancelled when the
corresponding floor is visited by the elevator.
• Each floor has two buttons (except the top and bottom floors), one to request upward travel
and one to request downward travel. These buttons illuminate when pressed. The
illumination is cancelled when an elevator visits the floor and is either moving in the desired
direction or has no outstanding requests.
• When an elevator has no requests to service, it should remain at its final destination with its
doors closed and await further requests. (An alternative would be to specify a floor to which
the elevator should return under these conditions.)
• All requests for elevators from floors must be serviced eventually, with all floors being given
equal priority.
• All requests for floors within an elevator must be serviced eventually, with floors being
serviced sequentially in the direction of travel.
• Each elevator has an emergency button that, when pressed, causes a warning signal to be
sent to the site manager. The elevator is then deemed "out of service." Each elevator has a
mechanism to cancel its "out of service" status.
Instructions
1. Focus primarily on requirements related to controlling the movement of each elevator in
response to passenger inputs and related factors (If you wish, you may include tables or
diagrams).
2. Divide all possible scenarios through use cases
3. Model the dynamic aspect of the system (State diagram) Exercise: 3
A POS (Point-Of-Sale) system is a computer system typically used to manage the sales in retail
stores. It includes hardware components such as a computer, a bar code scanner, a printer and also
software to manage the operation of the store. The most basic function of a POS system is to handle
sales. When a customer arrives at a POS counter with goods to purchase, the cashier will start a
new sale transaction. When the barcode of a good is read by the POS system, it will retrieve the
name and price of this good from the backend catalog system and interact with inventory system
to deduce the stock amount of this good. When the sale transaction is over, the customer can pay
in cash, credit card or even check. After the payment is successful, a receipt will be printed. Note
that for promotion, the store frequently issue gift coupons. The customer can use the coupons for
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
0
Software Engineering – Level II
a better price when purchasing goods. Another function of a POS system is to handle returns… A
user must log in to use the POS. The users of a POS system are the employees of the store including
cashiers and the administrator. The administrator can access the system management functions of
the POS system including user management and security configuration that cashiers can’t do.
The context diagram of the system given below:
1. Describe the interfaces of the application (to other systems/devices) using the following
template:
2. Define the user requirements, notably using a table with functional and non-functional
requirements. (Use the template given below)
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
1
Software Engineering – Level II
3. Define the user requirements. As an alternative to the technique above described each
requirement with the following form
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
2
Software Engineering – Level II
5. Define the use case Diagrams. Given the description of each use case in a table similar to the
following template:
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
3
Software Engineering – Level II
Tutorial set II
Exercise: 1
A bank system contains data on customers (identified by name and address) and their accounts.
Each account has a balance and there are 2 type of accounts: one for savings which offers an interest rate,
the other for investments, used to buy stocks. Stocks are bought at a certain quantity for a certain price
(ticker) and the bank applies commission on stock orders. Draw class diagram for that system.
Exercise: 2
You’re creating a digital doll program. What happens to the doll when he receives different stimuli is
determined by the state he’s in, so you decide to model the digital doll with a state diagram.
The behavior of the digital doll program is as follows:
When the doll is turned on, it starts out happy (happy doll state)
If the doll is happy and receives punishment, then he becomes sad
If the doll is sad and receives praise, it becomes happy
If the doll is sad and receives punishment, it is heart-broken
When it is turned off, it shuts down
IUGET-DOUALA/2020-2021/Level200/OOM-UML 2
4