SDA Lab 2 2k23 Part 1
SDA Lab 2 2k23 Part 1
Laboratory # 02
1/27/2025
UET TAXILA
Engr. Sidra Shafi
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.
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.
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:
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
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.
The current version of the Unified Modeling Language™ is UML 2.5, released in June 2015.
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.
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:
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.
It’s important to note that each subclass adds its own attributes and operations. Figure below shows
the superclass-subclass relationship.
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.
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:
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.
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.
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.
Figure: Objects are sometimes associated with each other in more than one way.
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
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).
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:
Install: Download the StartUML version 6 from the link given above and install it.