Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

Jackson Structured Programming and

Jackson System Development


SWE2004

Faculty:R.Kiruba Thangam
Introduction
 JSD acronym for Jackson System Development
 JSD is a structured systems analysis and design method
 JSD is used for developing a system with a strong time
dimension
 JSD systems are real-time
 Simulates events dynamically
 Combines reality-drive and information-system driven
approaches
 It uses Entity Structure Diagrams (ESD), Network Diagrams
(ND) and System Implementation Diagrams (SID) to model
a system.

Faculty:R.Kiruba Thangam
History
 Created by Michael A. Jackson and John Cameron in 1980’s.
 Created using the principles of JSP
 Jackson Structured Programming
 Developed in the 1970’s by Michael Jackson (Jackson, 1975)
 “Aspects of JSP are defused throughout JSD, so that the JSD
methodology is a significant development on its precursors, and
therefore should not be seen as a “front end” to JSP but an
extension of it, where JSP is the core” (Rawlings, n.d.)
 Orientated towards software and not organizational needs.

Faculty:R.Kiruba Thangam
Continued…
 Can be used to design programs for any programming
language with structured control constructs (e.g. C, Java,
Perl)
 Arguably one of the first Object Orientated software
development methods
 Identifies objects (entities) by time ordering events (actions)
 Updated versions have been described in:
 LBMS Jackson System Development (Wiley, 1992)
 Practical Program Development using JSP (Storer, 1987)

Faculty:R.Kiruba Thangam
JSP representation forms
 three ‘classical’ structuring forms
 sequence
 Selection
 Iteration
 it uses only a single diagrammatical form (Structure Diagram) in
its transformations
 The form of the Structure Diagram (‘tree’ form)
 A simple box denotes a component of a sequence
 A box with a circle in the upper right corner denotes selection from
an option,
 A box with an asterisk in the upper right corner denotes an iteration

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
The form of the Structure Diagram

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
JSD for Textbook
 Text contains preface, contents, book body , reference and index.
 Book body contains topics, which are presented in major parts,
chapters, sections and subsections that ore organized in a way
that facilitates understanding. Each chapter contains its own
title, chapter head (abstract or quotation), chapter body (it
contains section) and postscript (contains exercises)
 In section, section head and section body are presented. In
section body, diagrams and tables are also presented along with
text.

Faculty:R.Kiruba Thangam
A Jackson Structure Diagram describing a static object (the structure of a textbook)

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
The JSP process - five principal steps
1. Draw a Structure Diagram that describes each of the input and
output data streams.
2. Merge these to form the program Structure Diagram.
3. List the operations that need to be performed by the program,
and allocate each operation to an element in the program
Structure Diagram.
4. Convert the program to text without specific conditions for any
of the decision points.
5. Add the conditions used for each iteration and selection
operation.

Faculty:R.Kiruba Thangam
The JSP process

Faculty:R.Kiruba Thangam
Some rules for drawing Structure
Diagrams
 sequence is represented by unmarked boxes
 selection is represented by boxes marked with circles
 iteration is represented by an asterisked box
 sequencing is from left to right
 the three forms may not be mixed in a sequence
 the last selection part should always be conditionless (the
ELSE clause)

Faculty:R.Kiruba Thangam
Case study- Fuel filling station

Faculty:R.Kiruba Thangam
Case study
 A petrol filling station has a number of self-service pumps, each of which can be used
to dispense both diesel fuel and unleaded petrol. There is a small local computer in
each pump that maintains the display of price and volume on the pump; when the
customer returns the pump nozzle to its socket, this computer sends a record to the
cashier’s console computer, containing the details of the current transaction as the
sequence:
 pump identity;
 type of fuel;
 volume of fuel
 The problem is to design the software that receives these messages. For each message
it receives, the program is required to generate a line on the printer positioned in
front of the cashier, giving the details of the transaction in terms of
 pump identity;
 volume of fuel;
 total cost

Faculty:R.Kiruba Thangam
A petrol filling station
 a number of Selfservice pumps - used to dispense both diesel
fuel and unleaded petrol.
 a small local computer in each pump - maintains the display
of price and volume on the pump.
 pump identity; type of fuel; volume of fuel
 cashier’s console computer - containing the details of the
current transaction as the sequence
 Printer
 pump identity; volume of fuel; total cost

Faculty:R.Kiruba Thangam
Step 1: Draw the input/output Structure
Diagrams
Input Data Stream

Faculty:R.Kiruba Thangam
the levels of abstraction
 the pump record stream consists of many instances of a record;
 a record consists of the sequence:
 pump identity
 type of fuel
 volume of fuel
 the type of fuel field
 unleaded petrol
 diesel fuel.

Faculty:R.Kiruba Thangam
Output Data Stream

Faculty:R.Kiruba Thangam
the levels of abstraction
 the sales record stream consists of many instances of a record;
 a record consists of the sequence:
 pump identity
 volume of fuel
 total cost

Faculty:R.Kiruba Thangam
Step 2: Create the program Structure
Diagram
C---Data being consumed
P---Data being produced

Faculty:R.Kiruba Thangam
operations of the program
 repeatedly consuming a new input record and generating a new
output record;
 consuming and producing new records involves the following
sequence of actions:
 consuming and producing the pump identity
 consuming the type of fuel
 consuming and producing the volume of fuel
 producing the total cost of the transaction
 consuming the type of fuel involves consuming information to
indicate whether it is
 unleaded petrol or
 diesel fuel

Faculty:R.Kiruba Thangam
Step 3: List the operations and allocate
to program elements
 Outputs
(1) write pump identity
(2) write volume of fuel
(3) write cost to customer
 Inputs
(4) obtain pump identity
(5) obtain volume of fuel
(6) obtain type of fuel
(7) multiply type price per unit by volume dispensed

Faculty:R.Kiruba Thangam
The filling-station program: allocation of operations to program
elements.

Faculty:R.Kiruba Thangam
Steps 4 and 5: Convert program to text
and add conditions

Faculty:R.Kiruba Thangam
Some JSP heuristics
The use of read-ahead
 necessary to know something about
the next item of data to determine
how the current item should be
processed

Faculty:R.Kiruba Thangam
The use of read-ahead
 This statement is needed to ensure that when the conditional
expression used for the WHILE statement is first evaluated, it
will not cause the loop to terminate incorrectly before it has
begun.
 Even if the logic within the loop is correct, incorrect
initialization will lead to problems
 if one (say) attempts to perform input from an empty file by
using a loop that terminates on finding the end-of-line mark.

Faculty:R.Kiruba Thangam
Backtracking
 Backtracking
 ‘recognition difficulty’
 possible to use multiple read-ahead in such cases
 general technique of backtracking will need to be adopted
during step 4 of the basic JSP design process

Faculty:R.Kiruba Thangam
The basic steps of backtracking
 posit a default condition for use
in all cases, this being assumed
to hold until proved false;
 at those points following at
which it is possible to test the
hypothesis, insert ‘quit’
operations (where a ‘quit’ is
effectively a constrained GOTO
operation);
 provide for any necessary ‘undo’
operations to reverse the effect
of actions performed before the
path was proved to be the
wrong one.

Faculty:R.Kiruba Thangam
Continued…
 Program inversion (Cameron (1988a)) and structure clashes
 Structure clashes arise because of some implicit assumptions
that are made within the forms used in JSP.
 They are based on inconsistencies that arise in the ordering of
components when these are viewed at a lower level of
abstraction than is provided by the Structure Diagram.
 To handle these clashes without continual recourse to extra
sorting and merging routines, JSP has developed an associated
technique known as ‘program inversion’.

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
process of program inversion
 it leads to a solution based on the use of two coroutines,
rather than of a main program and a subprogram.
 coroutines resume execution from the point at which they
last transferred control
 subprogram is invoked, it always begins execution at its first
instruction
 Very few programming languages support the coroutine
mechanism

Faculty:R.Kiruba Thangam
Example
 structure of the library routine that might be designed with
JSP
 to extract records from the blocks
 pass them to a user program, one record at a time.
 Inversion of this program would then result in the
construction of two coroutines: main and getrecord

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
program inversion - ‘design heuristic’,
 it is a well-developed technique that can be used to
overcome a problem
 But that itself arises because of the needs and assumptions of
the method.
 Because the method assumes the existence of certain
ordering constraints upon the input streams,
 a technique is needed that can create these constraints
whenever a particular problem does not fit the requirement.

Faculty:R.Kiruba Thangam
Usages of JSP
 used to describe the structures of the program.
 It is concerned with the design of systems that
 are realizable as a single sequential process;
 have well-defined input and output data streams.
 JSP is therefore particularly well-suited to developing
systems that employ a pipe and filter architectural style.
 used to describe (View points)
 the form of a data structure (data modelling viewpoint);
 the sequencing of program actions (functional viewpoint);
 the sequencing of ‘states’ that might occur for some form of
‘object’ (behavioural viewpoint)

Faculty:R.Kiruba Thangam
Advantages
 It has limited and well-defined applications, which make it
possible to describe it more concisely yet fully than most
other design methods.
 Ever since its development in the early 1970s it has been
widely used, and therefore has a historical claim to be
discussed in depth.
 It is an excellent example of the use of a compositional
design strategy.
 It is well documented and widely used.

Faculty:R.Kiruba Thangam
JSD method
 encompasses both analysis and design activities,
 incorporated a large-scale ‘compositional’ design strategy,
based on the use of ‘long running’ virtual processes
(interacting concurrent processes) for its description, which
is then transformed into a ‘physical realization’ of the model
 also concerned with modelling processes rather than objects,

Faculty:R.Kiruba Thangam
Overview
 JSD can be described in phases and steps
 Three major phases of JSD:
 Modelling
 Network
 Implementation
 Broken into six steps
 First four concerned with deriving a specification for the
required system
 Last two concerned with implementation of the specification

Faculty:R.Kiruba Thangam
JSD framework
 The best framework for describing the broad process of JSD
design is that provided by Sutcliffe (1988) and also used in
Cameron (1988a)
 It is described in terms of the following three stages:
 a modelling stage,
 a network stage,
 an implementation stage,

Faculty:R.Kiruba Thangam
Top-level transformational model of JSD

Faculty:R.Kiruba Thangam
The JSD process
 The procedures involved in the ‘process part’ of JSD have
undergone a certain amount of revision and repackaging
since the method was first introduced.

Faculty:R.Kiruba Thangam
The JSD procedure as originally
described in Jackson (1983)

Faculty:R.Kiruba Thangam
The JSD procedure as revised by
Cameron (1986)

Faculty:R.Kiruba Thangam
The three-stage model of JSD as used in
Sutcliffe (1988) and Cameron (1988a)

Faculty:R.Kiruba Thangam
JSD representation forms
 Entity Structure Diagrams
 Entity
 An object that acts and is acted on by the system
 Action
 Carried out by entities and affect other entities
 Constructs – Sequence
 Use a sequence to demonstrate actions that are executed in order(left to right)

Faculty:R.Kiruba Thangam
Modelling Stage
 Events and entities are identified
 Entity structures and entity life cycles are formed.
 Result of this stage is a set of
 Tables
 Definitions
 Diagrams
 This describes:
 in user terms:
 the contents of the database, integrity and update rules.
 In implementation terms:
 Exactly what happens in the organisation

Faculty:R.Kiruba Thangam
Generic form of ESD
 creation of the entity in the model;
 actions performed by the entity while in existence;
 deletion of the entity from the model.

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
Exercise
Construct an ESD that describes:
(a) the ‘customer’ of a public lending library;
(b) the operational cycle of an automatic washing machine;

Faculty:R.Kiruba Thangam
Faculty:R.Kiruba Thangam
The System Specification Diagram (SSD)-
Network Diagram
 Represents interaction between processes
 Processes can be connected in two ways:
 DataStream
 Connect processes and specify what information is passed

Faculty:R.Kiruba Thangam
 State Vector

 Specify the characteristic or state of the entity being changed by a process

Faculty:R.Kiruba Thangam
Network Stage
 Inputs and outputs added to the derived model.
 Allows analysis of input and output subsystems
 The description of this is in terms of a network of program
 Network of Communicating Sequential Processes (CSP)
 Concept developed by Tony Hoare (Hoare 1985)

 Build network by:


 Making one program for each entity (from modelling)
 Add new programs and connect to existing network

Faculty:R.Kiruba Thangam
Processes with multiple input streams.
(a) Using a rough-merged form-the consumer is required to organize the handling
of multiple inputs through one read operation.
(b) Using separate ‘read’ operations - it must organize the
sequencing of consumption from the two sources

Faculty:R.Kiruba Thangam
A simple example of a segment from
an SSD

Circle - data-flow arc


Oblong box – entity
Diamond - state vector, associated with a
particular entity

Faculty:R.Kiruba Thangam
ATC-The modelling stage
 Entity analysis (the entity–action and entity–structure
steps)

 The JSD model at the end of the modelling stage.


 The notation is intended to indicate many instances of entities 2
and 3
Faculty:R.Kiruba Thangam
The network stage
 The initial model phase

 The JSD model at the end of the initial model phase of the network
stage
Faculty:R.Kiruba Thangam
Continued…
 The elaboration phase
 two separate transformation tasks
 the interactive function step, concerned with identifying those
events that affect the system and that cannot be derived from
considering external actions, and then designing additional
processes that will provide these events
 the information function step, which adds the processes and data
flows that are required for generating the eventual system outputs.

Faculty:R.Kiruba Thangam

You might also like