Jackson structured programming: Difference between revisions

Content deleted Content added
MalnadachBot (talk | contribs)
m Fixed Lint errors - replaced obsolete center tags. (Task 12)
m run on sentence
 
(10 intermediate revisions by 10 users not shown)
Line 1:
{{Short description|Computer programming method}}
[[Image:JSP RLE output1.png|thumb|240px|Example of a JSP diagram.]]
'''Jackson structured programming''' ('''JSP''') is a method for [[structured programming]] developed by British software consultant [[Michael A. Jackson (computer scientist)|Michael A. Jackson.]] and It was described in his 1975 book ''Principles of Program Design''.<ref name="PoPD">{{Citation | first = MA | last = Jackson | title = Principles of Program Design | publisher = Academic | year = 1975}}.</ref> The technique of JSP is to analyze the data structures of the files that a program must read as input and produce as output, and then produce a program design based on those data structures, so that the program control structure handles those data structures in a natural and intuitive way.
 
JSP describes structures (of both data and programs) using three basic structures – sequence, iteration, and selection (or alternatives). These structures are diagrammed as (in effect) a visual representation of a [[regular expression]].
 
== Introduction ==
[[Michael A. Jackson (computer scientist)|Michael A. Jackson]] originally developed JSP in the 1970s. He documented the system in his 1975 book ''Principles of Program Design''.<ref name="PoPD"/> In a 2001 conference talk,<ref name="perspective">{{Citation | first = MA | last = Jackson | title = JSP in Perspective | place = sd&m Pioneers’ Conference, Bonn, June 2001 | year = 2001 | url = http://mcs.open.ac.uk/mj665/JSPPers1.pdf | access-date = 2017-01-26 | archive-date = 2017-05-16 | archive-url = https://web.archive.org/web/20170516215344/http://mcs.open.ac.uk/mj665/JSPPers1.pdf | url-status = live }}</ref> he provided a retrospective analysis of the original driving forces behind the method, and related it to subsequent software engineering developments. Jackson's aim was to make [[COBOL]] [[batch file]] processing programs easier to modify and maintain, but the method can be used to design programs for any [[programming language]] that has structured control constructs&mdash; sequence, iteration, and selection ("if/then/else").
 
Jackson Structured Programming was similar to [[Warnier/Orr Diagrams|Warnier/Orr structured programming]]<ref>{{Citation | first = JD | last = Warnier | year = 1974 | title = Logical Construction of Programs | publisher = Van Nostrand Reinhold | place = NY}}</ref><ref>{{Citation | first = KT | last = Orr | year = 1980 | contribution = Structured programming in the 1980s | title = Proceedings of the ACM 1980 Annual Conference | publisher = ACM Press | place = New York, NY | pages = 323–26 | doi = 10.1145/800176.809987 | isbn = 978-0897910286 | s2cid = 26834496 }}</ref> although JSP considered both input and output data structures while the Warnier/Orr method focused almost exclusively on the structure of the output stream.
Line 55 ⟶ 56:
</syntaxhighlight>
 
Jackson criticises the traditional single-loop version for failing to process the structure of the input file (repeatinga groupssequence of recordsgroups containing repeating individual records) in a natural way. One sign of its unnatural design is that, in order to work properly, it is forced to include special code for handling the first and last record of the file.
 
== The basic method ==
Line 69 ⟶ 70:
* selections
 
The method begins by describing a program's inputs in terms of the four fundamental component types. It then goes on to describe the program's outputs in the same way. Each input and output is modelled as a separate [[Data structure diagram|Data Structure Diagram]] (DSD). To make JSP work for compute-intensive applications, such as [[digital signal processing]] (DSP) it is also necessary to draw algorithm structure diagrams, which focus on internal data structures rather than input and output ones.
 
The input and output structures are then unified or merged into a final program structure, known as a Program Structure Diagram (PSD). This step may involve the addition of a small amount of high level control structure to marry up the inputs and outputs. Some programs process all the input before doing any output, whilst others read in one record, write one record and iterate. Such approaches have to be captured in the PSD.
Line 85 ⟶ 86:
{{center|[[Image:JSP Sequence.png|A box labeled 'A' connected to three boxes below it labeled 'B', 'C' and 'D']]<br>A sequence}}
 
An iteration is again represented with joined boxes. In addition the iterated operation has a star in the top right corner of its box. In the example below, A is an iteration iteration of zero or more invocations of operation B.
 
{{center|[[Image:JSP Iteration.png|A box labeled 'A' connected to a box labeled 'B' below it with a star in the top right corner]]<br>An iteration}}
Line 164 ⟶ 165:
One of these situations is a case in which a program processes two input files, rather than one. In 1975, one of the standard "wicked problems" was how to design a transaction-processing program. In such a program, a sequential file of update records is run against a sequential master file, producing an updated master file as output. (For example, at night a bank would run a batch program that would update the balances in its customers' accounts based on records of the deposits and withdrawals that they had made that day.) ''Principles of Program Design'' provided a standard solution for that problem, along with an explanation of the logic behind the design.
 
Another kind of problem involved what Jackson called "recognition difficulties" and today we would call parsing problems. The basic JSP design technique was supplemented by POSIT and QUIT operations to allow the design of what we would now call a [[backtracking]] parser.
 
JSP also recognized three situations that are called "structure clashes"&mdash; a boundary clash, an ordering clash, and an interleaving clash&mdash; and provided techniques for dealing with them. In structure clash situations the input and output data structures are so incompatible that it is not possible to produce the output file from the input file. It is necessary, in effect, to write two programs&mdash; the first processes the input stream, breaks it down into smaller chunks, and writes those chunks to an intermediate file. The second program reads the intermediate file and produces the desired output.
 
== JSP and object-oriented design ==
JSP was developed long before object-oriented technologies became available. It and its successor method [[Jackson system development|JSD]] do not treat what now would be called "objects" as collections of more or less independent methods. Instead, following the work of [[C. A. R. Hoare]], JSP and JSD describe software objects as [[coroutine|co-routines]].<ref>{{Citation | first = R | last = Wieringa | title = A survey of structured and object-oriented software specification methods and techniques | journal = Comput SurvACM Computing Surveys| volume = 30 | issue = 4 |date=Dec 1998 | pages = 459–527 | doi=10.1145/299917.299919| citeseerx = 10.1.1.107.5410 | s2cid = 14967319 }}.</ref><ref>{{Citation | first1 = Brian | last1 = Henderson-Sellers | author1-link = Brian Henderson-Sellers | first2 = JM | last2 = Edwards | title = The object-oriented systems life cycle | journal = Communications of the ACM | volume = 33 | issue = 9 |date=Sep 1990 | pages = 142–59 | doi=10.1145/83880.84529| s2cid = 14680399 | doi-access = free }}.</ref>
 
== See also ==
Line 180 ⟶ 181:
== External links ==
{{Commons category|Jackson Structured Programming}}
* [http://www.sabretech.co.uk/pages/thought.html A free graphical JSP Editor written in JAVAJava]
* [https://www.his.se/en/about-us/staff/henrik.engstrom/jsp-editor/ A JSP editor]
* [http://www.jacksonworkbench.co.uk/stevefergspages/jackson_methods/index.html A brief history of the Jackson methods]