7.6 Other Action Languages


The object action language shown here is not the only syntax for object actions. In this section, we'll present two other languages that support the action semantics and compare how these languages present fundamental actions.

7.6.1 Small

SMALL[1] is a language invented as a precursor to the action semantics work.[2]Like the action semantics, execution proceeds in parallel[3] for all statements, except where constrained by data or control flow. Consequently, if two statements write the same variable and their order of execution has not been constrained, it is indeterminate which value will be used in subsequent processing.

[1] An acronym for Shlaer-Mellor Action Language. One L is gratuitous.

[2] The language was invented by Stephen J. Mellor, based on Peter Fontana's insight that all chains of operations end in a write, or a signal generation. Gregory Rochford and Cortland D. Starrett built a parser to verify the syntax.

[3] The statements proceed in parallel from the developer's perspective. The model compiler can serialize the statements as desired.

The key syntactic property of the language is its explicit use of data flow. Reading SMALL is like reading a shell script for UNIX that starts with a data-access operation and connects operations together using pipes. Consequently, assignments and other data flow from left to right, as shown in the example in Figure 7.13.

Figure 7.13. Actions in the Shipment State Machine

graphics/07fig13.gif

The syntax is summarized in Figure 7.14.

Figure 7.14. Actions in Small

graphics/07fig14.gif

For an example of iteration over a collection, see Figure 7.15. Here, we select the instances of the Book that have a copyright within the specified dates and access the associated book prices. This collection of values is piped to a separately defined function Factor, with a parameter 1.1, and the result is written to the bookPrice attribute against the set of Books. The expression Book( ) in a statement refers to the same set of books that were accessed by the original selection expression, avoiding any potential for data access conflict in the syntactic expression.

Figure 7.15. Iteration over a Collection in Small

graphics/07fig15.gif

7.6.2 Tall

TALL[4] is a functional language based on the action semantics work. Actions return values that can be used in other actions, and values may be provided as input to several concurrent actions.[5]

[4] The name is an acronym for That Action Language. One L is gratuitous.

[5] TALL was designed by Marc J. Balcer, Conrad Bock, and Dirk Epperson.

An example for the shipment state machine actions is shown in Figure 7.16.

Figure 7.16. Actions in the Shipment State Machine

graphics/07fig16.gif

An example of iteration over a collection is shown in Figure 7.17. The syntax is summarized in Figure 7.18.

Figure 7.17. Iteration over a Collection in Tall

graphics/07fig17.gif

Figure 7.18. Actions in Tall

graphics/07fig18.gif

7.6.3 Actions and Syntax

We have presented here, albeit briefly, three separate action languages. The languages are fundamentally different, yet they can all be expressed in terms of the action semantics.

We trust that this demonstrates conclusively that syntax is unimportant.

The actions described so far act on objects of classes, attributes, and associations. There are a few other actions that communicate between objects and other domains, which we describe when we introduce those concepts.

Now that we have an action language in hand, we can also employ it to define several additional constraints, the topic of the next chapter.



Executable UML. A Foundation for Model-Driven Architecture
Executable UML: A Foundation for Model-Driven Architecture
ISBN: 0201748045
EAN: 2147483647
Year: 2001
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net