0% found this document useful (0 votes)
96 views13 pages

SRE Lab 02

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views13 pages

SRE Lab 02

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA

FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

SOFTWARE REQUIREMENT ENGINEERING

LAB 02
Introduction to UML

OBJECTIVES:

 What is Software Requirement Specification Document


 What is the UML
 Why the UML is necessary
 What is StarUMl and how to install it

Software requirement specification Document:


Before developing a project the system has to be studied carefully.
From the day one we take notes and write everything regarding the system from scratch this is
called SRS Document. SRS includes the scope, purpose, authors, functional requirements,
software, tools, nonfunctional requirements etc.

Unified Modeling Language:


The Unified Modeling Language (UML) enables system developers to create blueprints that
capture their requirements in a standard, easy-to understand way, and provides a mechanism to
effectively share and communicate these requirements with others. It does this via a set of
symbols and diagrams. Each diagram plays a different role within the development process.

Components of the UML

 The UML consists of a number of graphical elements that combine to form diagrams.
 UML is a language; it has rules for combining these elements.
 The purpose of the diagrams is to present multiple views of a system; this set of multiple
views is called a model.
 A UML model tells what a system is supposed to do.

UML can be used with all processes, throughout the software development life cycle. UML is not
a methodology, it does not require any formal work products .Yet it does provide several types of
diagrams that increase the ease of understanding an application under development.
The most useful, standard UML diagrams are:
Software Requirement Engineering 2nd Semester-SE UET Taxila
UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

 Use case diagram


 Class diagram
 Sequence diagram
 State-chart diagram
 Activity diagram
 Component diagram
 Deployment diagram

Object Orientation Concepts:


Object Orientation

Person
Attributes: height, weight, and age.
Each of us is unique because of the specific values that each of us has for those attributes.
We also perform these operations: eat, sleep, read, write, talk, go to work, and more.

If we were to create a system that deals with information on people—say, a system for a human
resources department—we would likely incorporate some of these attributes and some of these
operations in our software.

Washing Machine

Attributes: brandName, modelName, serialNumber, and capacity


Operations: acceptClothes(), acceptDetergent(), turnOn(), and turnOff()

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Class:
In the world of object-orientation, a class is used for categorization.it is used to place all same
types of things under a single name. For example students together makes a class because they
have same education level, same subjects and they do same operation that is takeclass() etc.
A class is also a template for making objects sort of like a cookie cutter that you use to stamp out
cookies.

Object:
An object is an instance of a class (a category). You and I, for example, are instances of the
Person class. An object has structure. That is, it has attributes (properties) and behavior. An
object's behavior consists of the operations it carries out. You can create new objects based on
WashingMachine class. In a class students are objects of class. For example you all are objects of
2k12-SE class.

 Task 1:
Patient, software department, mobile phone, school, bus, Rawalpindi express

a. Identify the classes and objects from the list given above.
b. Write at least 3 attributes and 2 operations of each class found in above list.
c. Name the possible class of objects you found in above list.

Some Object-Oriented Concepts

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Object-orientation goes beyond just modeling attributes and behavior. It considers other aspects
of objects as well.

These aspects are called


 Abstraction
 Inheritance
 Polymorphism
 Encapsulation

Abstraction

Abstraction means, simply, to filter out an object's properties and operations until just the ones
you need are left. What does "just the ones you need” means?

Different types of problems require different amounts of information, even if those problems are
in the same general area. In the second pass at building a washing machine class, more attributes
and operations emerged than in the first pass. Was it worth it?

If you're part of a development team that's ultimately going to create a computer program that
shows exactly how a washing machine does washing. A computer program like that has to have
enough in it to make accurate predictions about what will happen when the washing machine is
built, fully functioning, and washing clothes.

For this kind of program, in fact, you can filter out the serial Number attribute because it's
probably not going to be very helpful.

What if, on the other hand, you're going to create software to track the transactions in a laundry
that has a number of washing machines? In this program you probably won't need all the detailed
attributes and operations mentioned in the preceding section. You might, however, want to
include the serialNumberof each washing machine object.

In any case, what you're left with, after you've made your decisions about what to include and
what to exclude, is an abstraction of a washing machine.

 Task 2:

First name, last name ,father name , date of birth, home address, matric marks ,intermediate
marks , college name, postal address, age, mother name, eyesight number, user name, email
id ,Facebook id, password, confirm password, security question ,security code, terms and
conditions.

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

a. From the above list write down the information that you will need to sign up in a
yahoo account.
b. From the list of information you gathered for signup in yahoo account abstract
the information that you will require to login to yahoo account.
 Task 3:

Build and decorate a house.

Inheritance
 Washing machines  dishwashers,
 refrigerators,  radios,
 microwave ovens,  blenders,
 toasters,  irons

What you say what are all these? These are all appliances. In the world of
object orientation, we would say that each one is a subclass of the Appliance
class. Another way to say this is that Appliances a super class of all those
others.

Appliances a class that has the attributes on Off Switch and electricWire, and
the operations turnOn() and turnOff(). Thus, if you know something is an
appliance, you know immediately that it has the Appliance class's attributes
and operations.

Object-orientation refers to this relationship as inheritance. Each subclass of


Appliance (Washing Machine, Refrigerator, Blender, and so on) inherits the
features of Appliance.

It's important to note that each subclass adds its own attributes and operations.
Figure 2.3 shows the superclass-subclass relationship.

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Inheritance doesn't have to stop there. Appliance, for example, is a subclass of


the HouseholdItemclass. Furniture is another subclass of Household Item, as
Figure 2.4 shows. Furniture, of course, has its own subclasses.

Figure 2.4. Super classes can also be subclasses and inherit from other super
classes.

 Task 4:

Car, Student, tree, mango tree, Patient, Person, BMW, things, Honda,
human, City, Vehicle, non-living things, bike, bicycle,animal,

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

mammal,reptile, horse, amphibian, snake , lizard, living things, frog,


plants

a. From the above list identify inheritance relationship among the


given classes. Hint: Remember that a super class can be sub
class of an other class

Polymorphism

Sometimes an operation has the same name in different classes. For example,
you can open a door, you can open a window, and you can open a newspaper,
a present, a bank account, or a conversation. In each case you're performing a
different operation. In object-orientation each class "knows" how that
operation is supposed to take place. This is called polymorphism.

Encapsulation

In a TV commercial, two people discuss all the money they'll save if they dial
a particular seven-digit prefix before dialing a long-distance phone call.

One of them asks, incredulously, "How does that work?" The other replies:
"How does popcorn pop? Who cares?"

That's the essence of encapsulation: When an object carries out its operations,
those operations are hidden. When most people watch a television show, they
usually don't know or care about the complex electronics components that sit
in back of the TV screen and all the many operations that have to occur in
order to paint the image on the screen. The TV does what it does and hides the
process from us. Most other appliances work same way.

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Turning from software to reality, you see the importance of encapsulation in


the objects you work with, too. Your computer monitor, in a sense, hides its
operations from your computer's CPU. When something goes wrong with your
monitor, you either fix the monitor or replace it. You probably won't have to
fix or replace the CPU along with it.

Interface:

Because encapsulation means that an object hides what it does from other
objects and from the outside world, encapsulation is also called information
hiding. But an object does have to present a "face" to the outside world so you
can initiate those operations. The TV, for example, has a set of buttons either
on the TV itself or on a remote. A washing machine has a set of dials that
enable you to set temperature and water level. The TV's buttons and the
washing machine's dials are called interfaces.

What is StarUML?
StarUML™ is a software modeling platform that supports UML (Unified
Modeling Language).
Installation Steps: Run the setup.

Step 1:

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Step 2

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Step 3

Step 4

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Step 5

Step 6

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

StarUML Environment

Software Requirement Engineering 2nd Semester-SE UET Taxila


UNIVERSITY OF ENGINEERING AND TECHNOLOGY, TAXILA
FACULTY OF TELECOMMUNICATION AND INFORMATION ENGINEERING

SOFTWARE ENGINEERING DEPARTMENT

Software Requirement Engineering 2nd Semester-SE UET Taxila

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy