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

SDA Lab 2 2k23 Part 1

The document outlines a laboratory session focused on software design and architecture, emphasizing the use of Unified Modeling Language (UML) concepts and tools like StarUML. It details the design process, architectural modeling, and object-oriented programming principles, including abstraction, inheritance, polymorphism, and encapsulation. Additionally, it introduces various UML tools and their features, providing students with the necessary knowledge to construct experiments and projects in software development.

Uploaded by

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

SDA Lab 2 2k23 Part 1

The document outlines a laboratory session focused on software design and architecture, emphasizing the use of Unified Modeling Language (UML) concepts and tools like StarUML. It details the design process, architectural modeling, and object-oriented programming principles, including abstraction, inheritance, polymorphism, and encapsulation. Additionally, it introduces various UML tools and their features, providing students with the necessary knowledge to construct experiments and projects in software development.

Uploaded by

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

Software Design and Architecture

Laboratory # 02

1/27/2025
UET TAXILA
Engr. Sidra Shafi

CLO Learning Outcomes Assessment Item BT Level PLO


No.
1 Construct the experiments / projects Lab Task, Mid Exam,
of varying complexities. Final Exam, Quiz,
P2 / C2 3
Assignment, Semester
Project
2 Use modern tool and languages. Lab Task, Semester
P2 5
Project
3 Demonstrate an original solution of Lab Task, Semester
A2 8
problem under discussion. Project
4 Work individually as well as in teams Lab Task, Semester A2 9
Project
Introduction to UML
Statement Purpose:
After this Lab, students will be able to:
• Understand Unified Modeling Language Concepts,
• OOP Concepts,
• Installation of Software Modeling Tool named Star UML.

UML Tool:
Star UML version 6.
Download Link: https://staruml.io/download/

Software Design:
The purpose of software design is “to produce a workable (implementable) solution to a given
problem.” David Budgen in Software Design: An Introduction.

The Design Process


Software design is an iterative process that is traceable to the software requirements analysis
process. Many software projects iterate through the analysis and design phases several times. Pure
separation of analysis and design may not always be possible.

Design Concepts:
• The design should be based on requirements specification.
• The design should be documented (so that it supports implementation, verification, and
maintenance).
• The design should use abstraction (to reduce complexity and to hide unnecessary detail).
• The design should be modular (to support abstraction, verification, maintenance, and
division of labor).
• The design should be assessed for quality as it is being created, not after the fact.
• Design should produce modules that exhibit independent functional characteristics.
• Design should support verification and maintenance.

Software Architecture:
Software architecture is a description of the subsystems and components of a software system
and the relationships between them.
You need to develop an architectural model to enable everyone to better understand the system,
to allow people to work on individual pieces of the system in isolation, to prepare for extension of
the system and to facilitate reuse and reusability.

4th Semester UET TAXILA


Describing an Architecture Using UML:
All UML diagrams can be useful to describe aspects of the architectural model. Four UML
diagrams are particularly suitable for architecture modeling:
• Package diagrams
• Subsystem diagrams
• Component diagrams
• Deployment diagrams

UML Tools:

1. StarUML

StarUML is an open-source software modeling tool. It has come up with eleven different types of
modeling diagrams. It also supports UML2.0 specified diagrams.

Features:
o It let you create Object, Use case, Deployment, Sequence, Collaboration, Activity, and
Profile diagrams.
o It is a UML 2.x standard compliant.
o It offers multiplatform support (MacOS, Windows, and Linux).

2. Visual Paradigm

A visual Paradigm is a tool that supports SysML, UML2, and Business Process Modeling Notation
from Object Management Group. It involves report generation as well as code generation.

Features:
o It supports all of the 14 UML2 diagrams.
o It supports BPMN 2.0, ERD, SysML.

Altova

Altova has provided UModel, which is another UML software modeling tool. It supports all types
of 14 UML2 diagrams as well as SysML for the embedded systems. It also holds up for business
process modeling for enterprise analysts. It generates visually designed software models by
incorporating Java, C++, and C #or Visual Basic .NET.

Features:

o It provides a dedicated toolbar for an individual diagram.


o It offers unlimited undo/redo, which inspires to discover new ideas.

4th Semester UET TAXILA


o In UML diagrams, you can easily add a hyperlink to any element.
o It also provides an intuitive color-coding, icons, customized alignment grid, and
cascading styles for colors, fonts line size.

3. Draw.io

Draw.io is an open-source modeling tool to create flowcharts, process diagrams, UML, ER, and
network diagrams.

Features:
o Since it is very easy to use, it provides an intuitive interface, drag& drop functionality, a
huge number of templates, and also, it does not need to install.
o It offers security and reliability.
o It can be used anywhere, both online and offline.
o It is compatible with every browser.

UML: Unified Modeling Language (UML) is a standard way to draw software models, sketch
out designs, or document existing designs and systems.

The Unified Modeling Language is a standard visual modeling language intended to be used for

• modeling business and similar processes,


• analysis, design, and implementation of software-based systems

UML is a common language for business analysts, software architects and developers used to
describe, specify, design, and document existing or new business processes, structure, and
behavior of artifacts of software systems.

UML can be applied to diverse application domains (e.g., banking, finance, internet, aerospace,
healthcare, etc.) It can be used with all major object and component software development
methods and for various implementation platforms (e.g., Java, .NET).

UML is a standard modeling language, not a software development process. UML 1.4.2
Specification
UML Diagrams:

The Figure shown below shows all diagrams which exists in UML.

4th Semester UET TAXILA


Figure: UML Diagrams

Version: UML 2.5

The current version of the Unified Modeling Language™ is UML 2.5, released in June 2015.

Components of the UML


• The UML consists of several 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.

Object orientation
An object has structure.
It has attributes (properties) and behavior.
An object's behavior consists of the operations it carries out.
Attributes and operations taken together are called features.

4th Semester UET TAXILA


Student class:

Attributes: Roll no., Courses_Taken, Semester and Session. (There can be many attributes). Each
student is unique because of the specific values that each student has for these attributes.
Students also perform these operations like: Check_Grades(), Check_Marks(),
Apply_Additional_Course(), Apply_for_Semester_Grade_Sheet().

If we want to create a system that deals with information on students—say, a system for an
Academic Cell—we would likely incorporate some of these attributes and some of these operations
in our software.

WashingMachine class:

Attributes brandName, modelName, serialNumber, and capacity


Operations acceptClothes(), acceptDetergent(), turnOn(), and turnOff()
You have a mechanism for turning out new instances of the WashingMachine class. That is, you
can create new objects based on this class.

Figure: Washing Machine Class

Some Object-Oriented Concepts


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

4th Semester UET TAXILA


• Message sending
• Associations
• Aggregation

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" mean?
Different type of systems requires different detail.
Example: To create software to track transactions in a laundry that has a number of washing
machines?
In this program all the detailed attributes and operations are not required. Only the serialNumber
of each washing machine object is required.

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

Inheritance:
Washing machines, refrigerators, microwave ovens, toasters, dishwashers, radios, waffle makers,
blenders, and irons 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 Appliance is a superclass
of all those others.
Appliance is a class that has the attributes onOffSwitch 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


(WashingMachine, 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 below shows
the superclass-subclass relationship.

4th Semester UET TAXILA


Figure: Superclass-Sub Class

Inheritance doesn't have to stop there. Appliance, for example, is a subclass of the HouseholdItem
class. Furniture is another subclass of HouseholdItem, as following Figure shows. Furniture, of
course, has its own subclasses.

Figure: Superclass can also be a Subclass of another Superclass.

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.

4th Semester UET TAXILA


Figure: In polymorphism, an operation can have the same name in different classes and proceed
differently in each class.

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.

Figure: An example of Encapsulation.

Why is this important? In the software world, encapsulation helps cut down on the potential for
bad things to happen. In a system that consists of objects, the objects depend on each other in
various ways. If one of them happens to malfunction and software engineers have to change it in
some way, hiding its operations from other objects means that it probably won't be necessary to
change those other objects.

4th Semester UET TAXILA


Message Sending:

In a system, objects work together. They do this by sending messages to one another. One object
sends another a message—a request to perform an operation and the receiving object performs that
operation.
Example: A TV and a remote present a nice intuitive example. When you want to watch a TV
show, you hunt around for the remote, settle into your favorite chair, and push the on button. What
happens?
• The remote-object sends a message to the TV-object to turn itself on.
• The TV-object receives this message, knows how to perform the turn-on operation, and
turns itself on.

When you want to watch a different channel, you click the appropriate button on the remote, and
the remote-object sends a different message—"change the channel"—to the TVobject. The remote
can also communicate with the TV via other messages for changing the volume, muting the
volume, and setting up closed captioning.

Figure: An example of Message Sending from one object to another. The remote-object sends a
message to the TV-object to turn itself on. The TV-object receives the message through its
Interface, an infrared receiver.

Associations
Another common occurrence is that objects are typically related to one another in some fashion.
For example, when you turn on your TV, in object-oriented terms, you're in an association with
your TV.

The "turn-on" association is unidirectional (one-way), as shown in following Figure. That is, you
turn your TV on. Unless you watch way too much television, however, it doesn't return the favor.
Other associations, like "is married to," are bidirectional.

4th Semester UET TAXILA


Figure: Objects are often associated with each other in some way. When you turn on your TV,
you're in a unidirectional association with it.

Figure: Objects are sometimes associated with each other in more than one way.

Figure: A class can associate with more than one classes

Aggregation:
Think about your computer system. It consists of a CPU box, a keyboard, a mouse, a monitor, a
CD-ROM drive, one or more hard drives, a modem, a disk drive, a printer, and possibly some

4th Semester UET TAXILA


speakers. Inside the CPU box, along with the drives, you have a CPU, a graphics card, a sound
card, and some other elements you would undoubtedly find it hard to live without.

Your computer is an aggregation, another kind of association among objects. Like many other
things worth having, the computer is made from several different types of components (see
Figure).

Figure: A typical computer system is an example of an aggregation—an object that's made up of a


combination of a number of different types of objects.

One form of aggregation involves a strong relationship between an aggregate object and its
Component objects. This is called composition. The key to composition is that the component
exists as a component only within the composite object. For example, a shirt is a composite of a
body, a collar, sleeves, buttons, buttonholes, and cuffs. Do away with the shirt and the collar
becomes useless. Sometimes a component in a composite doesn't last as long as the composite
itself. The leaves on a tree can die out before the tree does. If you destroy the tree, the leaves also
die.

Tool:

StarUML is a software modeling tool that supports UML.

The key features of StarUML are:

• Multi-platform support (MacOS, Windows and Linux)


• UML 2.x standard compliant
• SysML support
• Entity-Relationship diagram (ERD)
• Data-flow diagram (DFD)
• Flowchart diagram

4th Semester UET TAXILA


• Multiple windows
• Modern UX
• Model-driven development
• Asynchronous model validation
• Export to HTML docs
• Automatic updates.

Install: Download the StartUML version 6 from the link given above and install it.

4th Semester UET TAXILA

You might also like