CSC-3324: Chapter 6

judgedrunkshipServers

Nov 17, 2013 (3 years and 6 months ago)

84 views

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

1


CSC
-
3324:
Chapter
6



Software Design


Section 10.3 (except 10.3.1)

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

2


The Typical Waterfall model embeds the following
steps:


Feasibility study


Conceptual Analysis


Design


Implementation


Maintenance.

The Design Phase...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

3


Adapting

the
conceptual solution

identified during
the analysis step to the
technology enablers

(Platforms, Programming languages, DBMS, OS,
Devices, etc.) that can/will be used for the project…


Client constraints, Organizational constraints, the
requirements, the software engineer profile, etc;

The Design Phase...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

4


During the Design, we must perform the following
tasks and produce their corresponding deliverables:


Choose appropriate technology enablers...


Set the functional architecture…


Set the system architecture



Set the functions interactions (call, messages, events, etc.)…


Building the DFDs…


Building a logical data model...


Set the functions interface…


Write the algorithms...


Design the user interfaces...

The task to be performed...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

5

Choose appropriate technology enablers..


Programming language,


Web tools,


DBMS,


Network protocol,


Operating system,


User Interface development tool,


Platforms


Etc.

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

6

Set the functional architecture…


A Functional architecture contains,
in a tree like hierarchy
, all
modules

(
nodes
) and
functions
(
leafs
) of your system with the
exact names

as they will appear in the code…
Directly derived
from the conceptual architecture…


Given the
tools that have been selected

for the development, we
must
adjust

the leafs of the
conceptual architecture
...


This can lead to changing leafs names, adding/dropping some
hierarchical levels...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

7

Set the system architecture… (web
oriented architecture…)

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

8

Set the system architecture… (web
oriented architecture…)


The client presentation layer
: In web applications the user most often accesses this
tier through a web browser, but other entry points are possible, such as desktop
applications or entirely different devices using e.g. web services.



The Server
-
Side Presentation Layer:

contains the logic that allows the user to
navigate the application. In this layer the presentation of the content to the user is
determined.


This Server
-
Side Business Logic layer:

contains the business logic of the application.
The functionality is divided into modular components, called EJBs (Enterprise Java
Beans), and each bean is responsible for a defined area of the business logic, e.g.
price calculation or customer data.



Enterprise Information System layer
: is the database server, containing the raw data

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

9

Protocols of Web architecture


ODBC/

JDBC


Web tier




JSPs under

Apache/Tomcat




Windows/Linux

Application server

(Business tier)



Business
Rules/Logic


J2EE platform



Windows/Linux


Primary Server

Oracle/MySQL


Replication Server



Oracle/SQL Server

Replication
Data tier

Main Data tier

RPC/
RMI

PC Internet


Windows

Touch
Screen


Windows

PDAs



JAVA VM






H
T
T
P
S

Via GSM /GPRS or an access Point (using IEEE 802.11)




B
R
O
W
S
E
R
S

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

10

Set the functions interactions


How the different functions of the architecture are
linked

to each other…


Interactions/dynamic

model…


Focus on:


Time
… When is it called?


Sequence
… Who calls? To whom the output is destined?


Inputs
/
Outputs
;


Entrance
/
exit

Conditions...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

11

Set the functions interactions


Control models…


Sequential

(Centralized as called by Somerville)
control:


The call/return model;


The manager Model;


Event driven

programming…


Messages based

(OO) interaction…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

12

Set the functions interactions… DFDs


Data Flow Diagrams

(DFDs) are a good way to
graphically represent the functions interactions...


A DFD shows the
processing steps

as data

flows

through

a system...


We may need
separated DFDs

and
different levels of
abstractions
to model all processes…


Based on the CPMs and the functional architecture


Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

13

Set the functions interaction… DFDs


A good DFD,

must specify for
each
function
:



The Input data,



The entrance conditions (if ever),



The output data,



The exit conditions (if ever).

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

14

Set the functions Interaction… DFDs

C
o
m
p
l
e
t
e
o
r
d
e
r

f
o
r
m
O
r
d
e
r
d
e
t
a
i
l
s

+
b
l
a
n
k
o
r
d
e
r

f
o
r
m
V
a
l
i
d
a
t
e
o
r
d
e
r
R
e
c
o
r
d
o
r
d
e
r
S
e
n
d

t
o
s
u
p
p
l
i
e
r
A
d
j
u
s
t
a
v
a
i
l
a
b
l
e
b
u
d
g
e
t
B
u
d
g
e
t
f
i
l
e
O
r
d
e
r
s
f
i
l
e
C
o
m
p
l
e
t
e
d
o
r
d
e
r

f
o
r
m
S
i
g
n
e
d
o
r
d
e
r

f
o
r
m
S
i
g
n
e
d
o
r
d
e
r

f
o
r
m
C
h
e
c
k
e
d

a
n
d
s
i
g
n
e
d

o
r
d
e
r
+

o
r
d
e
r
n
o
t
i
f
i
c
a
t
i
o
n
O
r
d
e
r
a
m
o
u
n
t
+

a
c
c
o
u
n
t
d
e
t
a
i
l
s
S
i
g
n
e
d
o
r
d
e
r

f
o
r
m
O
r
d
e
r
d
e
t
a
i
l
s
Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

15

Set Functions Interface...


Parameters (type, number, source);


Local/Global Variables;


Central/shared Database;


Data structure…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

16

Building your logical data Model...


Database (Relational: E/R
-

Objects:
UML…)


Files...


Arrays...


Record…


Files/Queues...

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

17

Writing algorithms...


What is an algorithm?


What is the link with programming
languages?


What is the link with software engineering?


Basic algorithmic constructs…


How to write a good algorithms?


Strategies…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

18

Writing algorithms... Basic
algorithmic constructs…


Alternatives:


If
Condition

Then
Sequence1

Else
Sequence2



Case
Condition

Switch
Sequence

Break…


Iterations:


For
IntervalValues

Do

Sequence



Repeat
Sequence

Until
Condition…


While
Condition

Do…


Sequences:


Begin
Inst1 , Inst2, … , Inst
n
End.

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

19

Programming your system…


Coding different modules of your system
with respect to the Technology Enablers…


Component oriented programming…


Structured/Quality programming…


Documented/traceable programming…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

20

Structured/Quality Programming…


All variables used in the program must be:


Assigned
: must be given a value before being used;


Initialized
: must be given a value before being used
in a loop;


Precise
: must be given sufficient physical space in
accordance with their type;


Documented
: commented at declaration and at use


Auto
-
descriptive
: significant name…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

21

Structured/Quality Programming…


All functions/Modules must be:


Parametrable:
all inputs must be given as
parameters;


Encapsulated:

does not use global variables;


Generic /Abstract :

perform a precise task


that is understandable outside the technical context.


Documented
… minimum 10% ratio Code/Comment

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

22

Structured/Quality Programming…

General rules:


Indention…


Alignment…


One instruction per line…


Avoid spaghetti expressions…


No transtyping/Casting…


No more than 2 nested Ifs…


Use appropriate Iterative/alternative structures…

Soft. Eng. I, Fall 2006

Dr Driss Kettani, from I. Sommerville

23

Design the user interfaces...




See User Interface chapter slides...