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 SmallSMALL[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.
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 MachineThe syntax is summarized in Figure 7.14. Figure 7.14. Actions in SmallFor 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 Small7.6.2 TallTALL[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]
An example for the shipment state machine actions is shown in Figure 7.16. Figure 7.16. Actions in the Shipment State MachineAn 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 TallFigure 7.18. Actions in Tall7.6.3 Actions and SyntaxWe 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. |