|
|
| |||||||||||||||
|
Location http://www.cs.mun.ca/~ulf/mod/moc.html. Written 100304 by Ulf Schünemann. Copyright (C) 2004 Ulf Schünemann. back to: software objects | prog. lang. paradigms | MOC-extending features |
| «[I]t is helpful to think of a programming paradigm as an ontology. An ontology is concerned with that which populates a world of interest and it is concerned with the relationships among the existents of this world. Thus within any given ontology only certain kinds of things and relationships are assumed to exist. When viewed in this way a programming paradigm can be defined as a model or approach used in solving a problem. It is a model in the sense that is supports a particular way of modeling a problem domain. It is an approach in the sense that it defines a certain way of thinking about a problem and its solution» [G 244]. |
|
There are different ways of conceptualizing computation in computational systems:
A paradigm or model of computation (MOC) is
a meta-model[^] or "ontology",
which specifies what kinds of entities, relationships, and events
(software objects[^])
there are (to be modeled, described, specified)
in any particular (existing or to-be-developed) computational system.
Chosing a particular MOC for modeling computations therefore
means to subscribe to a particular way of conceptualizing computation,
and thus predetermines what the program can talk about,
and according to what a program can be partitioned.
A model of computation can be understood as a glas-box or as a grey-box theory of computation (on the programmed computer). See system modeling: the paradigms. MOCs are abstract models, which are abstract in several ways:
There can be different levels of detail:
The following some important abstract models of computation, where I tried to keep their phenomenological and causal aspects separate. |
A. "Impersonal" models of computation, with no explicit agent causing the events (they are caused by "the computer", which is not explicitly modeled).
Incremental Update MOC or Imperative MOC - the imperative paradigm's model of computation
| PHENOMENOLOGICAL
|
«The imperative paradigm is often viewed
as the "traditional" model of computation.
The imperative model closely matches the actual execution of the
computer on the underlying hardware.
Computation is viewed as a task being performed by a "processing
unit," which manipulates and modifies "memory."
Memory can be envisioned as a sequence of boxes, or pigeon-holes,
in which values are stored. ...
The computer itself is a data manager;
it follows a pattern of instructions, each instruction causing the
computer to extract certain values from memory, transform them in
some fashion, the place results back into memory locations.
...
| The imperative model is often described using the phrase "incremental changes to state." ... As computation preceeds the boxes remain fixed, but the contents continually change. A large structure, such as an array, is manipulated by modifying each individual element one-by-one. Thus, computation proceeds by modifying large structures a little at a time, until finally the intended result is achieved.» [Leda 9f]
CAUSAL
|
|
<<- |
|
|
| causes |
follows | \|/
| ||||||||||||||||||
Applicative Model of Computation
| PHENOMENOLOGICAL
|
«We are taught very early that computers do operations
on operands, and this computational model is preserved
through everything we learn subsequently. Once we know that larger
operators can be built out of stored sequences of operators, our
progress as programmers becomes a matter of increasing the number
of different operators we know ...
We think of the computer as two disjoint compartments, one
containing operators and the other operands, and we express our
intentions by selecting what operators are to be applied and to
what operands in what order.» [p 152 in
Brad J. Cox: Message/Object Programming:
An Evolutionary Change in Programmming Technology;
IEEE Software 1/1 1984]
[quoted from Quib 97].
|
Note that the applicative MOC supports operand-modifying operations (mutators). But in the applicative MOC it is ontologically impossible that the application of an operation modifies something that is not operand in the application. (If something is modified through the application then in the applicative MOC this implies that it is de-facto an operand.) CAUSAL
|
|
|
For an causal model of computation,
it remains to explain how it is determined
which operations to apply to which operands and in which order.
|
|
| |||||||||||||
|
/|\ | after each application of an operation, the yielded result can be used as operand to a different operation (determined in the causal model) the channel structure fixes whose operations' output data flows as input data to which other operations | \|/ |
B. Models of computation with different, explicitly modeled agents that cause the events. Therefore we can now talk of the model as a "system".
Dataflow MOC / Systems
| PHENOMENOLOGICAL
|
|
CAUSAL
|
|
| connects | |
|
For an causal model of computation,
we cannot take the processors as black-boxes,
but have to look into them and say how they determine
which consume events and produce events to cause and in which order.
|
|
| buffers | \|/
<<-
|
|
For examples of dataflow systems, see
|
| |||||||||||||||||||||||||
|
|
Object-based MOC, Object Systems or Message Passing Systems - the object paradigm's model of computation
[MCOM, Quib 99-104]
| PHENOMENOLOGICAL
|
|
«Computation is performed by objects communicating with each other, requesting that other objects perform actions. Objects communicate by sending and receiving messages. A message is a request for action bundled with whatever arguments may be necessary to complete the task.» [Leda 11]
|
|
|
/|\ | | current | |
<<- |
|
|
<<- |
|
/|\ |
| arguments |
\ sender (from),
|
\ receiver (to) \ \
|
identifies | \|/
| ____
|
|
Request.
«A request is an event:
a unique occurence during the execution of the computational system. A
request has associated information, which consists of an operation
and zero or more parameter values. A value may identify an object;
... The operation identifies the service to be performed;
the parameters provide the additional information
needed to specify the intended behavior.» [MCOM 5f].
| ||||||||||||||||||||||||||||||||
Extension: different Message Filtering MOCs / Systems
|
/|\ | | unicast to explicit receiver through object references multicast to implicit receivers (implicit transmission infrastructure) | \|/
|
|
controls
|
| | |||||||||||||||
Multiagent MOC / Systems or Event-driven Systems
| PHENOMENOLOGICAL
|
«The multiagent model
structures an interactive system into a
collection of specialized agents that produce and react to events.
An agent is a complete information processing system:
it includes event receivers and event transmitters, a memory to
maintain a state, and a processor that cyclically processes input
events, updates its own state, and may produce events or change its
interest in input event classes.
Agents communicate with other agents, including the operator
[computer user]. ...» [DevSWforUI, p 169]
| An event is characterized by its event class and, depending on the event class, arguments.
CAUSAL
|
|
|
|
|
/|\ | | current | |
<<-
|
|
For an causal model of computation,
it remains to explain how the agent determins
which events to broadcast and how to update its state, and in which order.
|
|
\|/
|
| | |||||||||||||||||
|
|
Object Change Propagation MOC / Systems
| PHENOMENOLOGICAL
|
|
For examples and CAUSAL MODELS see different kinds of constraint slots in objects.
|
| current | |
<<- |
|
----. | <<-'
|
| ||||||||||||||||||