6 Program Design - 240404 - 085437
6 Program Design - 240404 - 085437
Design
Week 6 - APSI
• The application logic for a system will be expressed in
programs that will be written during construction of the
new system.
• Program design is the part of the design phase of the
SDLC during which analysts determine what programs
will be written, create instructions for the
programmers about how the code should be written,
and identify how the pieces of code will fit together to
form a program.
Introduction • Activities involved in program design include:
1. Creating physical Data Flow Diagrams (DFDs) to
make implementation decisions for the new
system, such as selecting the appropriate
programming language(s).
2. Developing structure charts to determine the
organization of the system's processes.
3. Creating program specifications to provide
guidance to programmers regarding what they
should create.
Physical data flow
diagram
The physical data
flow diagram
• The physical DFD contains the
same components as the logical
DFD (e.g., data stores, data
flows), and the same rules apply
(e.g., balancing, decomposition).
• The basic difference between the
two models is that a physical DFD
contains additional details that
describe how the system will be
built.
Add implementation references.
physical processes.
Physical data
flows (1)
Logical data flow Implementation Sample physical data flow
Physical data
flows (2)
Physical data
store
2. Draw a human-machine boundary
• The third step is to add to the DFD additional processes, stores, or flows that
are specific to the implementation of the system and have little (or nothing)
to do with the business process itself.
• These additions can be due to technical limitations or to the need for audits,
controls, or exception handling.
Technical • Technical limitations occur when technology
cannot support the way in which the system
is modeled logically.
limitations • For example, suppose that a data store exists
on the logical DFD to hold customer
information, but the database technology
that will be used to build the system cannot
handle the large volume of customers in one
table.
• A physical DFD may need to have two data
stores—one for current customers and one
for old customers—so that the technology
will work properly.
• Audits, controls, or exception handling refers to
putting checks and balances in place in the
Audits, system in case something goes wrong.
• For instance, consider the search and browse
controls, or processes that we have been working with.
• Suppose that the project team is worried about the
exception transfer of purchase records to the purchase tunes
process.
handling • As a precaution, the team can place a data store
on the physical DFD that captures information
about each batch of records that is sent to the
purchase tunes process.
• In this way, if problems were to occur, there
would be a history of transactions that could be
examined or used for backup purposes.
4. Update the • The fourth step is to update the elements in
the data flows.
Module Couples
• A structure chart is composed of modules (lines of
program code that perform a single function) that
work together to form a program
• The modules are depicted by a rectangle and
connected by lines, which represent the passing of
control.
Module (2)
that execution of one or more of the subordinate
modules occurs in some cases but not in others.
• Structure charts can become quite unwieldy,
especially when they depict a large or complex
program.
• A circle is used to connect parts of the structure chart
when there are space constraints and a diagram needs
to be continued on another part of the page (i.e., an
on-page connector), and
• A hexagon is used to continue the diagram on another
page entirely (i.e., an off-page connector).
Couples
• Couples, shown by arrows, are drawn on the structure chart to show that
information is passed between modules, with the arrowhead indicating which way
the information is being sent.
• Data couples, shown by arrows with empty circles, are used to represent the
passing of pieces of data or data structures to other modules.
• Control couples, drawn with the use of arrows with filled-in circles, are used to
pass parameters or system-related messages back and forth among modules.
• In general, control flags should be passed from subordinates to control modules, but
not the other way around.
• The presence of couples signals that modules on the structure chart depend on each
other in some way.
Structure chart element Purpose Symbol
Structure chart
elements (1)
Structure chart element Purpose Symbol
Structure chart
elements (2)
Revised
structure chart
example of GPA
• Process models are used as the starting point for
structure charts.
• There are three basic kinds of processes on a process
model: afferent, central, and efferent.
structure
• Central processes perform critical functions in the
operation of the system
• Efferent processes deal with system outputs.
chart • Each process of a DFD tends to represent one module
on the structure chart, and if levelled DFDs are used,
then each DFD level tends to correspond to a different
level of the structure chart hierarchy (e.g., the process
on the context-level DFD would correspond to the top
module on the structure chart).
Transform
and
transaction
structures
Transaction structure
• The transaction structure is used when each
module performs one of a group of
individual transactions.
• This transaction structure contains a control
module that calls subordinate modules, each
of which handles a particular transaction.
• Transaction structures often occur where the
actual system contains menus or sub-menus,
and they are usually found higher up in the
levels of a structure chart.
• The high levels of the DFD usually represent
activities that belong in a transaction
structure.
Transform structure
• A transform structure has a control module that calls
several subordinate modules in sequence, after
which something “happens.”
• These modules are related because together they
form a process that transforms some input into an
output.
• Often, each module accepts an input from the
module preceding it, works on the input, then
passes it to the next module for more processing.
• The control module describes what the subordinates
will do (e.g., create student grade listing), and the
subordinates are invoked from left to right and
transform the student grade records into two types
of listings for student grades.
• In a levelled DFD, the lowest levels usually represent
transform structures.
Applying the concepts of building the structure chart
Step 1: Identify modules and levels for the structure chart
Applying the concepts of building the structure chart
Step 2: Add special connection to the structure chart
Applying the concepts of building the structure chart
Step 3: Add couples to the structure chart
Design guidelines
1 2 3 4 5
Build Build loosely Create high Avoid high Assess the
modules with coupled fan-In fan-out chart for
high cohesion modules quality
• Cohesion refers to how well the lines of code within
each structure chart module relate to each other.
• Ideally, a module should perform only one task, making
it highly cohesive.
Build • The more tasks that a module has to perform, the more
complex the logic in the code must be to implement the
modules tasks correctly.
• Typically, you can detect modules that are not cohesive
with high from titles that have an “and” in them, signalling that
the module performs multiple tasks.
cohesion
• Another signal of poor cohesion is the presence of
control flags that are passed down to subordinate
modules; their presence suggests that the subordinate
has multiple functions from which one is chosen.
• Factoring is the process of separating out a function
from one module into a module of its own.
Types Definition Example
Types of
cohesion (1)
Types Definition Example
Types of
cohesion (2)
• Coupling involves how closely modules are
Build inter-related, and the second guideline for
good structure chart design states that
loosely
modules should be loosely coupled.
• The numbers and kinds of couples on the
Types of
coupling (1)
Types Definition Example
Types of
coupling (2)
• Fan-in describes the number of control
modules that communicate with a
subordinate.
• A module with high fan-in has many different
control modules that call it.
• High fan-in indicates that a module is reused
Create high in many places on the structure chart, which
suggests that the module contains well-written
fan-In generic code.
• Fan-in also occurs when library modules are
used.
• Structures with high fan-in improve the
reusability of modules and make it easier for
programmers to recode when changes are
made or mistakes are uncovered, because a
change can be made in one place.
Which structure chart is better?
• Avoid a large number of subordinates
associated with a single control.
• A control module will become much less
Avoid high fan- effective when given large numbers of
out modules to control.
• The general rule of thumb is to limit a control
module’s subordinates to approximately
seven.
Which
structure
chart is
better?
üLibrary modules have been created whenever
possible.
üThe diagram has a high fan-in structure.
Tugas 1 - 3 dipresentasikan di pertemuan ke-7: system request, use case diagram, context
diagram, logical DFD, physical DFD.
Laporan lengkap tugas 1 - 3 (termasuk hasil revisi) diunggah di IDE paling lambat hari Selasa, 16
April 2024 pukul 17.00: cover (no klpk, NPM, nama), deskripsi perusahaan, system request,
kebutuhan fungsional, diagram konteks dan DFD logis, DFD fisik, structure chart (opsional).