0% found this document useful (0 votes)
22 views

CS 1212 Lecture 6

Uploaded by

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

CS 1212 Lecture 6

Uploaded by

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

CS 1212 SOFTWARE ENGINEERING

Lecture 6 – Software Design

Yahya Hamad Sheikh, PhD


[email protected]

The State University of Zanzibar,


Department of Computer Science and Information Technology
www.suza.ac.tz
DEFINING SOFTWARE DESIGN

• Software design is an iterative process through which requirements are


translated into a blueprint for constructing the software.
• Initially, the blueprint depicts a holistic view of software.
• Later, during the design process the software specifications are transformed
into design models, which describe the details of the data structures, system
architecture, interface, and components.
• We always strive for quality design. However, design quality is an elusive
concept. Quality depends on specific organizational priorities.
• A “good” design may be the most efficient, the cheapest, the most
maintainable, the most reliable, etc.
• In some cases these qualities might be contradicting
PROCESSES OF SOFTWARE DESIGN

• Software design comprises of six stages:


• Architectural design: Identify sub-systems.
• Abstract specification: Specify sub-systems.
• Interface design: Describe sub-system interfaces.
• Component design: Decompose sub-systems
into components.
• Data structure design: Design data structures to hold problem
data.
• Algorithm design: Design algorithms for problem functions.
ARCHITECTURAL DESIGN

• Architectural design defines the relationships among the major structural


elements of the software.
• It is key to a design of any software, and often follows sort of design pattern.
• Having explicit architecture has benefits in software development, including:
• Architecture may be used as a focus of discussion by system
stakeholders. Hence improved stakeholder communication.
• It provides a means to further analyse whether the system can meet its
non-functional requirements such as performance, reliability and
maintainability is possible.
• The architecture may be reusable across a range of systems with similar
requirements, facilitating large scale reuse.
ARCHITECTURAL DESIGN PATTERNS

• An architectural design pattern is a general, reusable solution to a commonly


occurring problem in software architecture within a given context
• Architectural patterns are similar to software design pattern but have a
broader scope.
• There are different architectural design patterns used nowadays, including:
• Layered pattern
• Client-server pattern
• Master-slave pattern
• Peer-to-peer pattern
• Model-view-controller pattern
ARCHITECTURAL DESIGN PATTERNS
– LAYERED PATTERN

• Layered pattern is used to structure programs that can be decomposed into


groups of subtasks, each of which is at a particular level of abstraction.
• Each layer provides services to the next higher layer.
• The most commonly found 4 layers of a general information system are as
follows.
• Presentation layer (also known as UI layer)

• Application layer (also known as service layer)

• Business logic layer (also known as domain layer)

• Data access layer (also known as persistence layer)

• Typical usages of layered pattern are on the general desktop applications and
e-commerce web applications.
ARCHITECTURAL DESIGN PATTERNS
– CLIENT-SERVER

• This pattern consists of two parties; a server and multiple clients.


• The server component will provide services to multiple client
components.
• Clients request services from the server and the server provides
relevant services to those clients. Furthermore, the server
continues to listen to client requests.
• Typical usages are online applications such as email, document
sharing and banking.
ARCHITECTURAL DESIGN PATTERNS
– MASTER-SLAVE

• This pattern consists of two parties: master and slaves.


• The master component distributes the work among identical slave
components, and computes a final result from the results which the
slaves return.
• Typical usages include in database replication, where the master
database is regarded as the authoritative source, and the slave
databases are synchronized to it.
• Another usage is on peripherals connected to a bus in a computer
system (master and slave drives)
ARCHITECTURAL DESIGN PATTERNS
– PEER-TO-PEER

• In this pattern, individual components are known as peers.


• Peers may function both as a client, requesting services from other
peers, and as a server, providing services to other peers.
• A peer may act as a client or as a server or as both, and it can
change its role dynamically with time.
• Typical usages are in file-sharing networks such as Gnutella and
G2, in multimedia protocols such as P2PTV and PDTP.
ARCHITECTURAL DESIGN PATTERNS
– MODEL-VIEW-CONTROLLER

• In Model-View-Controller (MVC) an interactive application in to three


parts:
• model — contains the core functionality and data
• view — displays the information to the user (more than one view
may be defined)
• controller — handles the input from the user
• This is done to separate internal representations of information from
the ways information is presented to, and accepted from, the user.
• MVC decouples components and allows efficient code reuse.
ARCHITECTURAL DESIGN PATTERNS
– MODEL-VIEW-CONTROLLER

• In Model-View-Controller (MVC) an interactive application in to three parts:


• model — contains the core functionality and data
• view — displays the information to the user (more than one view may be
defined)
• controller — handles the input from the user
• This is done to separate internal representations of information from the ways
information is presented to, and accepted from, the user.
• MVC decouples components and allows efficient code reuse.
• Typical usages are the architecture for web apps in major programming
languages, and in web frameworks such as Django and Rails.
ARCHITECTURAL DESIGN PATTERNS

• Discussion Forum:
• Discuss how the modern e-commerce applications deploy the
layered architectural pattern.
• How does the layered architecture facilitate the security of the
credit cards of purchasers?
• Please continue the discussion on the Moodle e-learning platform.
ARCHITECTURE AND SYSTEMS CHARACTERISTICS

• The choice of particular architecture usually affect system characteristics such as


performance, security, safety, availability and maintenance
• To improve performance, localise critical operations and minimise
communications, and hence use large rather than fine-grain components.
• To increase security, use a layered architecture with critical assets in the inner
layers.
• To improve safety, localise safety-critical features in a small number of sub-
systems.
• To ensure availability, include redundant components and mechanisms for fault
tolerance.
• To enhance maintainability, use fine-grain, replaceable components.
ARCHITECTURE AND SYSTEMS CHARACTERISTICS

• While it is desirable to ensure all system characteristics are considered when


designing the architecture, this often leads to architectural conflicts.
• For example,
• Using large-grain components improves performance but reduces maintainability.
• Introducing redundant data improves availability but makes security more
difficult.
• Localising safety-related features usually means more communication so
degraded performance.
• So, it is the responsibility of the design engineers to understand and hence
prioritise the characterises based on the contextual requirements of the system
to be developed.
STEPS OF ARCHITECTURAL DESIGN

• Architectural design is a three-step process:


• System structuring, where a system is structured into a number of sub-systems,
and communications between these units are identified.
• A sub-system is an independent software unit; it is a system in its own right,
whose operation is independent of the services provided by other sub-systems.
• Control Modeling, where a general model of the control relationship is
established.
• Modular decomposition, where each identified sub-system is decomposed into modules. At
this stage, the architect decides on the types of modules and their interconnections.
• A module is a system component that provides services to other components but
would not normally be considered as a separate system.
END OF LECTURE


You might also like