1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams...

36
1 SSPD Back to Jackson • Consider how JSP views programming- – Describe structure I/O datastreams – Combine to produce a program structure – List operations necessary to produce outputs; put each operation in place in program structure – Write the program text adding conditions as needed for controlling iterations & selections.

Transcript of 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams...

Page 1: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

1SSPD

Back to Jackson

• Consider how JSP views programming-– Describe structure I/O datastreams– Combine to produce a program structure– List operations necessary to produce

outputs; put each operation in place in program structure

– Write the program text adding conditions as needed for controlling iterations & selections.

Page 2: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

2SSPD

Description First

• In JSP we first describe the subject matter of the problem.

• Then we turn attention to functional details

• Notice how technical detail is relegated.

Page 3: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

3SSPD

Abstraction in JSP

• Notice that the models we build (the data structure) are abstract descriptions of the real world.

• Whatever we include in the model can be used to produce system outputs.

• If it isn’t in the model, we can’t produce outputs in respect of it.

Page 4: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

4SSPD

JSD Same Foundations• The subject matter in JSD is the real

world, strongly ordered in time, outside the system

• Detailed function is production of system outputs

• Early development concerned with description of real world.

• Explicit consideration of function deferred.

Page 5: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

5SSPD

JSD

• JSD does not start from a given specification, nor does it decompose the system into sequential processes.

• Instead, development begins by creating a specification for the system, building it up from parts which are themselves sequential processes.

Page 6: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

6SSPD

Synthesis

• Therefore, we say that JSD is an activity of synthesis rather than decomposition.

• Used to develop systems in whose real world subject matter it is important to recognise occurrence of events within a time dimension.

Page 7: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

7SSPD

KEY IDEA

• It is claimed that easier to build more maintainable systems with JSD…

• …because the model of real world is a stable basis for development, being less likely to change than the functions built upon it.

Page 8: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

8SSPD

Model & Function

• In JSD we say that– the model implies function– i.e., we can specify any function in terms

of members of the model.

• But in dysfunctional decomposition– the functions imply the model– i.e., we build a model in terms of required

functions. This is inherently less flexible.

Page 9: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

9SSPD

Page 10: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

10SSPD

Car Hire Revisited

• Let’s take a JSD view of the car hire problem.

• What is the real world of the car hire firm’s manager?

• The hiring and returning of vehicles.

• Thus we can model a vehicle

Page 11: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

11SSPD

Model of Vehicle

VEHICLE

PURCHASE DISPOSEWORKINGLIFE

HIRING

HIRE RETURN

*

Page 12: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

12SSPD

Model Implies Function

• The requirements for the system were (in order):-– Display number of hirings– Display average hiring duration

• Functional spec:- – Inspect model and count all hire events– Inspect model and evaluate period for each

vehicle.– etc.

Page 13: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

13SSPD

Model Implies Function II

• Second requirement:-– Display longest hiring

• Functional spec:-– Inspect model, for each hiring evaluate

duration– Calculate longest period

Page 14: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

14SSPD

Model Implies Function III

• The third requirement was:-– Display hirings < 1 week– Display hirings >= 1 week

• Functional spec:-– Inspect model. For each hiring, calculate

duration. If 6 days or less put in one batch else put in the other.

Page 15: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

15SSPD

Model Implies Function IV

• The final requirement was:-– Allow the system to run at any time even

when there are outstanding returns

• Functional specification:-– Inspect the model. For each of the above

requirements, ignore any hiring which has a hire event but no matching return event.

Page 16: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

16SSPD

Immortality?

• Is a JSD system therefore immortal?

Page 17: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

17SSPD

Jackson System Development

Introduction

Page 18: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

18SSPD

Warning!

• Some of the concepts in JSD are not easy to grasp at first

Page 19: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

19SSPD

Data Modelling

• Recall the data modelling relation:Supplier I tem Project

S1 I678 P54

S1 I789 P54

S1 I678 P37

S2 I678 P37

S2 I678 P42

… … …

What does is-a-supplier-of mean?

Discuss relation in terms of events.

Page 20: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

20SSPD

Understanding Relations

• Natural way to understand meaning of relation is to consider the real world events that affect it.

• Natural way to explain relation is in terms of those real world events.

• Event occurrence more basic than existence of a relation, thus that is where we will start our modelling.

Page 21: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

21SSPD

Events in JSD

• Events are:– atomic– instantaneous

(both ideas are abstractions)

• Example: lending a book in a library system

Page 22: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

22SSPD

Event Attributes

• What, who, when, where etc…• E.g., what was lent? When was it lent?

Who lent it and to whom? etc.• Gives us attributes such as:

– date,– ISBN– Borrower id etc. etc.

for the LEND event

Page 23: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

23SSPD

Define Event Classes

• LEND (Book_Id, Member_Id, Resvn_Id, Date)– A book, whose identifier is Book_Id, is lent

to the member whose membership number us Member_Id; date is the date of removal of the book from the library's premises; Resvn_Id is the identifier of the relevant reservation if the cook is borrowed against a previous reservation.

Page 24: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

24SSPD

Importance of Events

• Initial description in terms of what happens in the real world

• Doing this begins to scope the eventual system

• Narrative gives link between the formal system spec we are building and the real world as understood by its users

Page 25: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

25SSPD

Objects & Event Orderings

• Picture is not complete. Events are participated in by real world objects (e.g. librarians and borrowers)

• We want to describe these objects that persist over time

• Analysing event traces helps us to identify the objects of interest

Page 26: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

26SSPD

Event Trace Analysis

…Hire (Veh 3), Ret (Veh 2), Purchase (Veh 9), Hire (Veh 2), Hire (Veh 9), Hire (Veh 3), Ret (Veh 2), Ret (Veh 3), Ret (Veh 9)…Dispose (Veh 2), Hire (Veh 9), Ret (Veh 9), Dispose (Veh 9)…

• Analysis of this elicits time ordered event lists

• From this we derive candidate entities

Page 27: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

27SSPD

EntitiesEntity persists over time & participates in time ordered event traces.

VEHICLE

PURCHASE DISPOSEWORKINGLIFE

HIRING

HIRE RETURN

*

Page 28: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

28SSPD

Entity State

• Entities have state.

• State is recorded in entity’s fields (its instance variables)

• The entity state vector will store info about the entity’s event history

• E.g., Vehicle’s present state is ‘ON HIRE’, previous states include PURCHASE, HIRE, RETURN etc.

Page 29: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

29SSPD

Entity Attributes

• Attributes specified in terms of events• E.g., HIRE_COUNT• Also need to specify what attributes

mean• E.g., is HIRE_COUNT incremented upon

hiring out, or upon return?• What does attribute in-the-company

mean?

Page 30: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

30SSPD

Definitions of Event

– Something that happens to which the system has to respond…they cause a response in the system and an update to the information stored within the system [Sutcliffe]

– An event in the world that forms the subject matter of the system and about which the system must produce or use information [Cameron]

Page 31: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

31SSPD

Definitions of Entity

– Object of interest in the system which will undergo or cause change during system’s activity [Sutcliffe]

– Object in the real world which participates in a time-ordered set of actions [Jackson]

– Person, organisation or object that performs or suffers an interesting time sequence of actions [Cameron]

Page 32: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

32SSPD

Finding Events

• Events are atomic so reject those actions that are vague or that imply continuous actions

• Ignore (for the moment) any actions which imply output or responses in the real world. In the modelling phase events are those actions which respond in some way to input messages

Page 33: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

33SSPD

Guidelines– Decide on the external events which

happen in the real world (e.g. customer orders goods)

– Define how these events are communicated to the system as input (e.g. phone call is made)

– Identify system inputs (action attributes) (e.g. a verbal order)

– Define actions necessary to respond to messages in action attributes (e.g. despatch goods).

Page 34: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

34SSPD

Action Attributes

• Are answers to reasonable questions we might ask about an event– e.g., what was lent, who lent it etc.

Page 35: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

35SSPD

Finding Entities

• Start by analysing event traces (could be a lot of work here!)

• Look for real world objects with which the system must interact

• What is the main thing for which the system exists?

• Entities could be the nouns in event descriptions

Page 36: 1SSPD Back to Jackson Consider how JSP views programming- –Describe structure I/O datastreams –Combine to produce a program structure –List operations.

36SSPD

Try this Out

• Have a go at the Stitch in Time company.