HCT210 Lecture Notes - Unit 3
HCT210 Lecture Notes - Unit 3
Unit 3 : Design
Unit Outline
• Concepts
• Architectural Design
• Component-Level Design
• User Interface (UI) Design
• Design Patterns
Design: Introduction
• Software design involves a set of principles, concepts
and practices that lead to the development of high-
quality software
• For design, software engineers are looking more at the
solution domain (rather than the problem domain
when doing requirements)
• The output is models that are used for system
implementation, i.e. models that are architectural,
interface, component-level and deployment
representations of the system
• The input is the requirements (analysis) models
• Design methodologies are always evolving; and various
methods should be employed to get a better picture
Design: Introduction
• Requirements models are the input; so thus they feed
into the design process to produce the design models /
artefacts
Requirements models Design
Scenario-based models Component-level design
Data based models Interface design
Class-based models Architectural design
Flow-oriented models Data / Class Design
Behavioural models
Design Concepts
• Design concepts have developed over time; all
aiming to answer the following questions:
1. How do we partition software into components?
2. How do we separate data structure and function
detail from conceptual representation of software?
3. What uniform criteria define the technical quality of
software design ?
• M. A. Johnson said: “the beginning of wisdom is
to recognise the difference between getting a
program to work, and getting it right”
• The next slides look at some design concepts
HCT210: Software Engineering Gibson Mukarakate 7
Unit 3: Design
Design Concepts
1. Abstraction
Explore many levels of abstraction, from high (in problem
domain) to the lowest (in solution domain)
2. Architecture
Design should derive an architecture of the system;
within which more detailed design is conducted.
Architecture is structure of program components
(modules), how they interact, and the structure of the
data they use
3. Patterns
Apply existing patterns to problems with known
solutions. A design pattern is an insight which conveys
the essence of a proven solution to a recurring problem
within a certain context
Design Concepts
4. Separation of Concerns
This concept suggests that design can be handled if
the complex system is divided into pieces of separate
concerns. A concern is a feature / behaviour of a
system
5. Modularity
Design should divide the system into separate
modules to handle complexity. Note that; at some
point the sub-division will start to be not beneficial,
or even costly
6. Information hiding
In order to sub-divide a system, look at ways you can
ensure that data and algorithms in each module are
inaccessible to other modules
HCT210: Software Engineering Gibson Mukarakate 9
Unit 3: Design
Design Concepts
7. Functional Independence
A module should be “single-minded” and “averse to
excessive interaction with others”. It is assessed by
two quality attributes: cohesion and coupling
8. Refinement
Refinement, usually from high to low abstraction
levels, adding more detail. It is an “elaboration”
process.
9. Aspects
Isolate “cross-cutting concerns” (“aspects”) so that
they can be re-used by various modules
HCT210: Software Engineering Gibson Mukarakate 10
Unit 3: Design
Design Concepts
10. Refactoring
a technique of re-organising a design (or code)
by simplifying it, but without changing its
functionality
11. Object-oriented Design concepts
Concepts used in OOD
They basically focus on creating design classes.
There are different analysis classes are discussed
in the next slides, together with the design
concepts applied for classes
HCT210: Software Engineering Gibson Mukarakate 11
Unit 3: Design
Architectural Design
• Concerned with structure of data and system
components; and their inter-relationships
• Architecture is overall structure / “shape”
• The output is overall data and program
structure; and their inter-relationships
• Architectural design elements are made from
different viewpoints
• There are various architectural design
patterns that can be applied
HCT210: Software Engineering Gibson Mukarakate 20
Unit 3: Design
Architectural Structures
• There are five foundation architectural
structures; as described by their components,
relationships (connectors) and properties that
differentiate the components and connectors:
1. Functional: components are functions or processing
units; while connectors represent interfaces that
“pass data to” or “use” another component
2. Implementation: components are packages, classes,
procedures functions, etc that represent different
levels of abstraction. Connectors are for passing data
and control. Properties focus on quality of the
structure
Architectural Structures
3. Concurrency: components are units of
concurrency
4. Physical: focus on where components are
located, e.g. deployment
5. Developmental: relating to work products
during the software engineering process
Architectural Styles
• a design may also fit a particular well known
architectural style or form. The are various
styles:
1. Data-centred : a data store is at the center
2. Data-flow: focus on inputs, processes and
outputs
3. Call and return: function id decomposed into a
control hierarchy and components invoke each
other
4. Object-oriented: components encapsulate data
5. Layered: system decomposed into various layers
HCT210: Software Engineering Gibson Mukarakate 23
Unit 3: Design
Used by
Target System
Uses
Uses Peers
Actors
Depends on
Subordinate systems
Component-Level Design
• Elaborates the architectural design by designing
the details within each component
• For each component, the following details are
designed:
i. Data structures
ii. Algorithms
iii. Interfaces and communication mechanisms
• A component is a modular, deployable, and
replaceable part of a system that encapsulates
implementation and exposes a set of interfaces
• It is an iterative elaboration process
HCT210: Software Engineering Gibson Mukarakate 34
Unit 3: Design
Component-Level Design:
The Component
• The are different views of components:
1. Object-oriented view
Detailed set of collaborating classes; with their operations,
attributes, relationships
Derived from the analysis classes
2. Traditional (functional) view
The component is a functional element with processing
logic and its data structures; and can be: control, problem
domain or infrastructure component
They are derived from data flow diagrams
3. Process-related view
Used when components are designed from existing re-
usable components
UI Golden Rules:
1. Place the User in Control
i. Define interaction modes in a way that does
not force a user into unnecessary or
undesired actions
ii. Provide for flexible interaction
Different mechanisms for different people, e.g.
keyboard, mouse, touch, voice, etc
iii. Allow user interaction to be interruptible and
undoable
iv. Streamline interaction as skill levels advance
and allow the interaction to be customised
HCT210: Software Engineering Gibson Mukarakate 52
Unit 3: Design
UI Golden Rules:
1. Place the User in Control
v. Hide technical internals from the casual user
Users should not know underlying technology and
system commands
vi. Design for direct interaction with objects
that appear on the screen
Allow users to manipulate objects in ways that are
close to what they do in the physical world
UI Golden Rules:
2. Reduce the User’s Memory Load
1. Reduce demand on short-term memory
Reduce the user's requirement to remember past actions and results
by providing visual cues of such actions, e.g. the “bread crumb trail”
2. Establish meaningful defaults
Meaningful defaults for values; and user can reset back to them
3. Define shortcuts that are intuitive
E.g. keyboard shortcuts with appropriate letter; or highlighted
letter
4. The visual layout of the interface should be based
on a real world metaphor
5. Disclose information in a progressive fashion
E.g. hierarchical menus
HCT210: Software Engineering Gibson Mukarakate 54
Unit 3: Design
UI Golden Rules:
3. Make the Interface Consistent
• Interface presentation and information acquisition
mechanisms should be consistent, implying:
i. Visual information displays consistently throughout all screens
ii. Input mechanisms are limited to a limited set that is used
consistently within the system
iii. Mechanisms for navigating from task to task are consistently
defined and implemented
1. Allow the user to put the current task into a
meaningful context
Icons, colour coding, tiles should show where the user is
2. Maintain consistency across a family of applications
3. If previous models have created user expectations, do
not make changes unless there is a compelling reason to
do so
HCT210: Software Engineering Gibson Mukarakate 55
Unit 3: Design
1. User analysis
Users are the ones who will use the system
Focus on analysing the users; and how they will use the
system
Questions include: user skills/education, user language,
from which departments, their age, consequences of
making mistakes, working times, remuneration, gender,
etc
HCT210: Software Engineering Gibson Mukarakate 57
Unit 3: Design
Design Patterns
• A design pattern describes a problem that
occurs repeatedly, a solution that can be
applied to it; and the context in which it
occurs
Context allows the reader to understand the
environment within which problem occurs, the
appropriate solution within that environment
A set of requirements, limitations and constraints act
a system of forces to influence how the problem is
interpreted within that context
• Patterns are a key foundation for reuse
HCT210: Software Engineering Gibson Mukarakate 66
Unit 3: Design
Design Patterns
• Design patterns in software engineering have
their origin from building architecture:- from
the writings of the building architect
Christopher Alexander in the 1970s
• In software engineering one of the early
seminal works is “Design Patterns: Elements of
Reusable Object-Oriented Software” (Gamma,
et al) which is popularly known as the “Gang of
Four” or “GoF” book
• It is one of the first book to have
comprehensively cover the topic of software
design patterns; and was within the “object-
oriented” paradigm
HCT210: Software Engineering Gibson Mukarakate 67
Unit 3: Design
Pattern-based Design
• Pattern-based design is usually used alongside
other design methods
• It comes in when the problem is extracted; and
the designers look if any design applies to it:
1. Extract problems
2. Extract the problems context forces (limitations &
constraints)
3. If a pattern addresses the problem, then do design tasks (see
later). If not; use other methods.
• The patterns will then be incorporated in the
design model; like elements from any other
methods
HCT210: Software Engineering Gibson Mukarakate 73
Unit 3: Design
Pattern-based Design:
“Thinking in patterns”
• Patterns thinking is enabled by the following
approach:
1. Understand the big picture
2. Examine the big picture and extract patterns at that
abstract level
3. Begin with the big picture patterns to establish context
4. Work inward from the context to get lower level
patterns
5. Repeat Steps 1-4 until the is a complete design
6. Refine the design: adapt each pattern to your specific
software
HCT210: Software Engineering Gibson Mukarakate 74
Unit 3: Design
Pattern-based Design:
Using the Pattern-organising Table
• Once patterns have been identified, categorise them
using a pattern-organising table as shown below:
Database Application Implementation Infrastructure
Data / Content
Problem statement … Patten name(s) Patten name(s) Patten name(s)
Problem statement … Patten name(s) Patten name(s)
Architecture
Problem statement … Patten name(s) Patten name(s) Patten name(s)
Problem statement … Patten name(s) Patten name(s) Patten name(s)
Component-level
Problem statement …
Problem statement … Patten name(s) Patten name(s)
User Interface
Problem statement … Patten name(s) Patten name(s)
Problem statement … Patten name(s) Patten name(s)
Design Patterns:
Common mistakes
• Patterns are not a solution to everything; there
can be the following common mistakes:
i. Misfit: Forcing a pattern to fit where it doesn’t.
This will negatively affect the system design and
architecture
ii. Not using a pattern where it should be used: This
will result in a poor design, “reinventing the
wheel”, wasting time, inefficiency
• Mistakes can be addressed by using design
reviews to ensure proper fit
HCT210: Software Engineering Gibson Mukarakate 82
Unit 3: Design
END