Professional Documents
Culture Documents
CSC2073 - Lecture 30 (Software Design Principles - I)
CSC2073 - Lecture 30 (Software Design Principles - I)
Fundamentals
CSC-2073
Lecture No. 30
Dr. Muhammad Adeel
Department of Computer Science
National Textile University
dr.muhammad.adeel.ntu@gmail.com
Last Lecture Review
Layered Architecture
1) Correctness:
The design of a system is correct if the system
built precisely according to the design satisfies
the requirements of that system
2) Verifiability:
Design should be verified for correctness
Verifiability is concerned with how easily the
correctness of the design can be checked
3) Completeness:
All the different components of the design should
be verified
7 Software Engineering - CSC2073
Design Objectives/Properties
4) Traceability:
Entire design element be traceable to the
requirements
5) Efficiency:
Proper use of scarce resources by the system
6) Simplicity:
The most important quality criteria for software
systems
8 Software Engineering - CSC2073
Software Design Principles
What do we want?
Low coupling. Why?
Replaceable
Enable changes
Testable - isolate faults
Understandable
Highly Coupled - Many dependencies
class Complex
{
public double real;
public double imaginary;
class Complex
{
private double real;
private double imaginary;
Low Cohesion - The parts e.g. functions Medium Cohesion - Some logically
have less or nothing in common related function. e.g. IO related functions
What do we want?
High cohesion. Why?
More understandable
Easier to maintain
High Cohesion - Does only what it is
designed for?
class Order
{
private int OredrID;
private string CustomerName;
private Date OrderDate;
private float TotalPrice;
private int CustomerID;
private int CustomerPhone;
class Order
{
private int OrderId;
private Date OrderDate;
private float TotalPrice;
public int getOrderID();
class Customer
{
private int CustomerID;
private string CustomerName;
private int CustomerPhone;
Software Design
– Design Activities
– Design Objectives/Properties
Software Design Principles
– Modularity
o Coupling
o Cohesion
– Interfaces