close

Вход

Забыли?

вход по аккаунту

?

on Flow-Based Programming

код для вставкиСкачать
FLOW-BASED PROGRAMMING
J.Paul Morrison
J.P. Morrison Enterprises Ltd.
Symptoms of the Problem
пЃ® Missed deadlines; budget overruns
пЃ® "Hidden" application backlog
пЃ® Fads and "snake-oil salesmen"
 Endless number of “new”, incompatible,
tools and languages to be learned
пЃ® "Reinventing the wheel"
пЃ®
03/25/07
Hard-to-maintain systems
3
The Real Cause of the Problem:
The von Neumann Model
пЃ® Inappropriate for application design:
- Code is procedural, sequential
- One-step-at-a-time view of processing
- Hierarchic structure of code
- Subroutine call as building block
- Programmer has to control exact sequence
of events
пЃ® Procedural approach is rare in real life...
and always difficult
пЃ® Real life is asynchronous, cooperative
03/25/07
4
Maintainable Systems
пЃ® Express problem in terms of transforms on
streams of data
пЃ® Most design technologies describe applications
this way – then design has to be converted to
procedural code
 “Unit Record” had these characteristics
 Precoded, pretested black-box (“LEGO”)
components have long been IT goal
03/25/07
5
FBP Characteristics
пЃ® Asynchronous processes communicating
via streams of data packets
пЃ® Data packets with a lifetime of their own
пЃ® Definition of connections external to
components
пЃ® Consistent view from macro to micro, and
from design to maintenance
03/25/07
6
Soft Drink Bottling Factory
пЃ® Independent well-defined functions
пЃ®
пЃ®
пЃ®
пЃ®
03/25/07
Clean interfaces
Simple to reconfigure
Minimizes side-effects
Designer can sit at one “station”, or can
follow an item through system
7
Elements of FBP
пЃ® Processes (A, B, C)
 Connections (M, N) - “bounded buffers”
пЃ® Ports (O1, O2, IN of B, IN of C)
пЃ® Connections defined externally to processes
пЃ® Streams of data chunks (Information Packets)
03/25/07
8
Traditional “Update” Application
03/25/07
9
FBP “Update” Application
complementary components
could be subnet
( m1 d11 d12 ) ( m2 ) ( m3 d31)
03/25/07
10
“Coordination Language” (*)
 Flow-Based Programming is a “coordination
language”, not a programming language
пЃ® FBP is language-independent
пЃ® One language doesn't have to do everything
 (*) Term borrowed from “Linda” (Gelernter &
Carriero - Yale)
пЃ® FBP is visual and component-oriented
 “Utilities”
can be turned into components
03/25/07
11
“Configurable Modularity”
“Characteristic of any engineered system”
03/25/07
(Nate Edwards, IBM)
12
Component-Oriented
пЃ®
пЃ®
пЃ®
пЃ®
“Black boxes”
Parametrization using “IIPs”
Ports
Parameters may be mini-language
Compatible with:
03/25/07
пЃ® Finite State Machines (PDAs)
пЃ® Structured Analysis
пЃ® Step-wise decomposition
13
Scheduling Rules
пЃ® Process only terminates when no more data,
although it may suspend or go dormant
пЃ® Process can suspend on receive or send
(connections are “bounded buffers”)
пЃ® This allows large amounts of data to be
processed using finite resources
пЃ® Typically only one process suspended waiting for
an event – not whole program
03/25/07
14
Design for an E-Brokerage Application
03/25/07
15
Load Balancing
03/25/07
 Sn is instance of “S”
пЃ® LB assigns on basis of least backlog
 “O[n]” is element of array port
16
17
Testing
Look at data passing across connection
Test one process at a time
“Scaffolding”
Rapid Prototyping
Go from simulation to working code
Cleave network as desired – multiple job
steps, regions, machines, etc.
03/25/07
18
Simulating Subroutines
пЃ¬
Subroutine can be simulated using Send/Receive
пЃ¬
MCBSIM can also be used in “flow-through” mode
“There is no reason we know of, however, to base
an entire parallel language on this one easily
programmed but not crucially important special
19
03/25/07 Gelernter
case."
пЃ¬
“Active” vs. “Passive” Objects
 FBP processes are “active objects” (*)
пЃ® Information packets (IPs):
- have a definite lifetime
- have only one owner at a time (or are
on a connection)
- “passive” objects
 5 types of “encapsulation”
пЃ®
03/25/07
(*) Ellis & Gibbs (1989)
20
FBP Implementations
пЃ® AMPS
z90 Assembler (IBM Canada – ca. 1970)
(in continuous, daily use since then)
пЃ® DFDM
Assembler / PL/I (IBM Canada, Japan)
пЃ® THREADS
пЃ®
пЃ® JavaFBP
пЃ® C#FBP
written in C (JPM)
- just ported to C++ fibers
Java
(J. Cowan, JPM, now at 5.0)
C#
(Amanda Ge, JPM)
пЃ® 03/25/07
“language-agnostic” - interface is data
21
Project
3 Projects
A
B
C
Type
Project
Unique
133
Occurrences
Reuse
Factor
184
1.4
Gen
21
Purpose
305
14.5
Total
154
489
3.2
GP/T
0.14
0.62
Project
46
48
1.0
Gen
17
Purpose
306
18.0
Total
63
354
5.6
GP/T
0.27
0.86
Project
2
54
27.0
Gen
8
Purpose
216
27.0
Total
10
270
27.0
GP/T
0.80
0.80
Figure
of Merit
0.27
0.13
0.01
22
Figure of Merit = Project Unique / Total Occurrences
Inter-language communication
Sockets
can be used between languages on
same machine, or
to communicate between different
machines
MQSeries, ActiveMQ, TIBEMS, etc.
03/25/07
23
DrawFBP Diagramming Tool
Written using Java Swing
03/25/07
24
Data format for DrawFBP
<net>
<title>Update</title>
<blocks>
<block>
<x> 560 </x> <y> 152 </y> <id> 6 </id>
<description>
Print Report</description>
</block>
</blocks>
<connections>
<connection> <fromx>108</fromx> <fromy>60</fromy>
<tox>168</tox> <toy>84</toy> <fromid>1</fromid>
<toid>3</toid>
<bends>
<bend> <x>132</x> <y> 60</y> </bend>
<bend> <x>132</x> <y> 84</y> </bend>
</bends>
</connection>
</connections>
</net>
03/25/07
25
Related Concepts
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
пЃ®
03/25/07
MASCOT (RSRE, UK)
Linda - Gelernter & Carriero (Yale)
A'UM - Yoshida & Chikayama (Japan)
BSP - Valiant
NIL/Hermes - Rob Strom (IBM)
“Media Objects” / KNOs - Nierstrasz etc.
“Active Objects” - Ellis & Gibbs
IBM’s MQSeries
Message-driven EJBs
Trelliswerk, ProtoSW
Pervasive, Ascential (now IBM)
Visual Frameworks
etc., etc., etc.
26
FBP Summary
пЃ® Flow-Based Programming: effective way to
produce reliable, maintainable, large
business applications
пЃ® Consistent view across all levels
пЃ® Better way to program multiprocessor
computers, distributed systems
пЃ®
Increasing interest world-wide
пЃ®
It’s taken 30+ years, but we’re getting there!
03/25/07
27
“State of the Art”
03/25/07
28
Документ
Категория
Презентации
Просмотров
10
Размер файла
590 Кб
Теги
1/--страниц
Пожаловаться на содержимое документа