Tuesday, 23 June 2009

Week 24/25 of 2009

Progress has been slow over the last few weeks since I have been away in Nottingham empting a 20ft storage container holding all sorts of junk! I'm now trying to focus exclusively on coding operation support in OOA Tool. If I were working in a team as I have done in the past then we would sit around planning and reviewing a detailed design before we started coding each set of features. However, when you are working alone then the only approach that works in my experience is continuous prototyping and refactoring. Unfortunately, it can result in wasted effort when bad design decisions are discovered. I had planned on releasing Build 014 ages ago but implementing operation support has raised lots of issues which have lead to rework several times. In the previous weeks I have nailed down Recursive Design bridging operations. During the last week I have sorted out operation ownership which I discuss below. However, there is still more coding to do before operation support is finished.

In OOA09, operation ownership is split between real ownership and name ownership. Real ownership is the natural consequence of which OOA of OOA element is responsible for defining what operations, e.g. a Bridge defines and thus owns bridge operations. Name ownership is a partial relationship (i.e. not all operations are named) connected with Action Language syntax (i.e. how names are used to identify specific operations within code). All operations now have a mathematically dependent Name Owner Category attribute whose value is either:

  • None indicating an operation has no name,
  • Owner indicating the real owner is also the name owner,
  • Active Object indicating the active object associated with the lifecycle model which is the real owner defines the naming context,
  • Partitioning Object indicating the partitioning object associated with the multiple assigner model which is the real owner defines the naming context,
  • or Supertype Object indicating the supertype object of the subtype-supertype relationship associated with the polymorphic destination which is the real owner defines the naming context.
This attribute is used to navigate a mathematically dependent relationship to the name owner of a given operation. This classification took some time to resolve and there are issues with allowing non-Object owners to be name owners, e.g. Executable UML associates all operations with Classes while single assigner models in OOA09 can define state model processes whose names must be qualified using the assigner label prefix of their owner.

The table below lists all operation types along with their real owners and name owners:

OperationOwnerName Owner Category
Domain ObserverDomainNone
Bridge MappingBridgeNone
FunctionInformation ModelOwner
Attribute CalculationObjectNone
Relationship NavigationMathematically Dependent RelationshipNone
ActionState ModelNone
Synchronous ServiceTerminatorOwner
State Model ProcessLifecycle ModelActive Object
State Model ProcessSingle Assigner ModelOwner
State Model ProcessMultiple Assigner ModelPartitioning Object
Polymorphic ProcessPolymorphic DestinationSupertype Object
Bridging ProcessTerminatorOwner
Synchronous Return WormholeTerminatorNone
Asynchronous Return WormholeTerminatorOwner

From the table, it is clear that many operations have no name since they can't be explicitly invoked and thus require no name. Synchronous return wormholes require no name since they are always invoked on a specific return coordinate. Asynchronous return wormholes are given a name even though they are always invoked on a specific transfer vector but only so that transfer vector types can be meaningfully labelled.

Sunday, 7 June 2009

Week 22/23 of 2009

I've been working on Recursive Design bridges, Process Model operations and Action Language statements. Over the last few weeks I've published a number of technical notes on synchronous communications, asynchronous communications and semantic shift in an effort to nail down exactly how operations of all kinds will be implemented in OOA09 projects. A number of bridge mapping variations were explored before I settled on what was discussed in the technical notes, e.g. watchpoint mappings have been replaced with domain observers. These technical notes will continue to be tweaked (e.g. there are a few counterpart mapping points which I skipped over that are worth discussing) until I have finishing implementing the discussed logic in OOA Tool which I am in the process of doing. I've also published a draft overview of the OOA09 Action Language. However, this won't be complete for a while yet since I want to implement some of the syntax first.

During this work, I've noticed that Mathematically Dependent Objects (which would be called derived classes in xtUML if the concept existed) exist in several subsystems of my OOA of OOA, i.e. objects with no user changeable attributes at all. The first example being completely predefined data types (not core types) which are automatically created when certain related objects are created, e.g. an Object Instance Type is created whenever an Object is created. The second example being predefined parameters which are automatically created when certain operation related objects are created. Now, I've already added Mathematically Dependent Relationships (called derived associations in xtUML) as a new concept to OOA09 after Mathematically Dependent Attributes were added in OOA96. Should I add Mathematically Dependent Objects as well? The concept definitely exists and is a logical extension of what already exists. What would the semantics be? What hooks would I need to add? When would the hooks be triggered? Could they be implemented efficiently? However, I'm not going to sidetrack the next build with this as a new feature but I will continue to explore it as a concept. Let me know if anyone has any related ideas.

Monday, 1 June 2009

Semantic Shift

Semantic shift occurs when a data value of one data type is converted into a data value of another data type. All such conversions require a semantic shift mapping. OOA09 specifies a set of predefined semantic shift mappings which can be used within a domain or between two different domains. OOA09 also allows counterpart mappings and user-defined semantic shift mappings to be defined on a bridge. All semantic shift mappings are implicitly invoked during Action Language assignment or parameter passing. Counterpart mappings and user-defined semantic shift mappings can only be implicitly invoked within bridge mappings and domain observers since they always involve data types from different domains. Although there is no Action Language cast operator, a declare statement can be used to perform an explicit semantic shift, e.g.

declare n as Real;
declare integer_n as Integer = n;

There are many situations where a semantic shift mapping can result in an error. If a user wants to handle the error within their Action Language code then the semantic shift must be performed between a mandatory attribute or data item and a conditional attribute or data item, e.g.

declare text as String = "Hello World";
declare unsafe_text as empty or one String = text;

// The following generates a run-time error!
declare unsafe_n as Integer = text;

// The following is entirely safe
// as long as the necessary checks are performed
declare safe_n as empty or one Integer = text;
if (empty safe_n)
   // Handle syntax or out of range error...
end if;

// The following generates a run-time error!
declare unsafe_m as empty or one Integer = unsafe_text;

// The following is entirely safe
// as long as the necessary checks are performed
if (empty unsafe_text)
   // Handle missing text...
end if;
declare safe_text as String = unsafe_text;
declare safe_m as empty or one Integer = safe_text;
if (empty safe_m)
   // Handle syntax or out of range error...
end if;
In addition to type specific errors, a semantic shift between a conditional attribute or data item and a mandatory attribute or data item always generates a run-time error when the source value is empty, i.e. a NullPointerException in Java.

It is important to note that bridges do not define their own data types. All data types referenced within a bridge mapping are from either the client or server domain. All data types referenced within a domain observer are from one of the domains defined within the domain observer's enclosing project. It is also worth noting that the only data stored in a bridge is cached counterpart mappings. The Shlaer-Mellor concept of semantic shift was first discussed in [Wormhole96].

The Executable UML core types (Boolean, String, Integer, Real, Date, Timestamp and Arbitrary_ID) which are all predefined types in OOA09 are not global types. However, there are predefined semantic shift mappings between the same core types in all domains, i.e. core types from all domains can be used interchangeably.

There are predefined semantic shift mappings between all boolean types since all boolean values have the same semantics or meaning in OOA09 even if they have different aliases. There is also a predefined mapping to String which converts a boolean value to the boolean type's notation independent alias for that value, e.g. Boolean true value maps to "True" (not Shlaer-Mellor "TRUE" or Executable UML "true"). The reverse String to boolean type mapping is also predefined where aliases or the hard-coded "True" or "False" names are fuzzy matched according to standard name comparison conventions (see Naming).

There are no predefined semantic shift mappings between any enumerated types since each legal value has its own unique meaning. A user-defined semantic shift mapping (which should always use a switch statement for safety) must be defined whenever any such conversion is required. However, there is a predefined mapping to String which converts an enumerated value to the enumerated type's notation independent name for that value. The reverse String to enumerated type mapping is also predefined where legal value names are fuzzy matched according to standard name comparison conventions.

There are no predefined semantic shift mappings between symbolic types in general since each symbolic type is assumed to have unspecified but definite semantics. The only exception involves the core type String which has no syntax, semantics or length restrictions. All symbolic types have a predefined semantic shift mapping to String. The reverse String to symbolic type mapping is also predefined. However, an error will occur if a target pattern is not matched or text length is invalid.

There are no predefined semantic shift mappings between numeric types in general since each numeric type is assumed to have unspecified but definite semantics. However, there are predefined semantic shift mappings between all numeric types and several core types including String, Integer and Real since core types are assumed to have no domain specific semantics. Additionally, there are predefined semantic shift mappings between all numeric types with a Time value format and the core types Date and Timestamp. There are also predefined semantic shift mappings going in the reverse direction in both cases. For all numeric values, truncation of decimal places may occur during a semantic shift. For time values, scaling up or down of time units may also occur during a semantic shift. However, one should note that time values in OOA09 are always stored as universal time (i.e. GMT) values relative to the Java Date Epoch (1 January 1970).

There are predefined semantic shift mappings between all arbitrary ID types and several core types including String and Integer. There are also predefined semantic shift mappings going in the reverse direction. These are in addition to the predefined semantic shift mappings between Arbitrary_ID core types in all domains. However, great caution should be used when passing arbitrary ID values around since arbitrary ID attributes may have their values reallocated automatically whenever object instances are created or deleted or whenever related object instances are assigned new arbitrary ID values.

There are no predefined semantic shift mappings between object instance types. However, a counterpart mapping can be defined between an object instance in one domain and an object instance in another domain. A counterpart mapping operation is invoked whenever a specific object instance in the client domain is shifted for the first time. The operation is expected to return the counterpart object instance in the target domain. The operation may return nothing if the counterpart mapping is conditional. However, the operation will not be invoked again in the future. Once a counterpart mapping has been established between two object instances then the link remains in a bridge cache until either of the object instances is deleted. This is not a flexible mapping for dynamic counterpart relationships. It is equivalent to joining two classes in different packages using multiple inheritance. It creates a permanent link which is only broken when one part is deleted. Although counterpart mappings are one-way, a counterpart mapping and it's reverse mapping share the same bridge cache. Once a link has been formed in either direction, a semantic shift can be performed in both directions as long as counterpart mappings were defined in both directions. Dynamic counterpart relationships can still be created using user-defined semantic shift mappings between object instance types. However, such mappings are always re-invoked when a semantic shift is requested, i.e. counterpart mappings will always be much faster.

There are no general purpose predefined semantic shift mappings involving event instance, return coordinate or transfer vector types. However, an event instance type for a solicit event parameter of a request wormhole has a predefined mapping to a transfer vector type for an event data item or input parameter of a control reception point (see Asynchronous Communications between Domains). In the opposite direction, a transfer vector type for a self parameter of an asynchronous return wormhole has a predefined mapping to an event instance type for a self parameter of an asynchronous return mapping.

There are predefined semantic shift mappings between all data types and all external types (in another domain) since converting an arbitrary data value into an external value only involves wrapping the original data value as an external value. No information is lost in the process. However, the reverse mapping is not so straightforward. If an external type has only been mapped from a single data type (across all bridges) then the reverse mapping is entirely safe. Otherwise, the reverse mapping is only safe if the wrapped data value has exactly the same type as the target type. An error is generated if the actual type does not match the target type.

User-defined semantic shift mappings can only be defined in a bridge between client and server data types. An analyst should not need to define a mapping between two data types within the same domain. User-defined semantic shift mappings between boolean types should never be defined since boolean value semantics are fixed across all domains. User-defined semantic shift mappings involving core types should also never be defined since core value semantics are also fixed across all domains. A user-defined semantic shift mapping between a pair of object instance types should not be defined if a counterpart mapping for that pair is already defined. User-defined semantic shift mappings should also not involve return coordinate or transfer vector types. Finally, user-defined semantic shift mappings must never involve external types since the predefined semantic shift mappings involving external types always take precedence. Given these restrictions and rules, user-defined semantic shift mappings should never overlap any of the predefined semantic shift mappings.

Semantic shift mappings are summarized in the following table:

Source TypeTarget TypeSemantic Shift Mapping
Boolean TypeBoolean Typepredefined
Boolean TypeStringpredefined
StringBoolean Typepredefined
(error if boolean value not fuzzy matched)
Enumerated TypeStringpredefined
StringEnumerated Typepredefined
(error if legal value not fuzzy matched)
Symbolic TypeStringpredefined
StringSymbolic Typepredefined
(error if pattern not matched or length invalid)
Numeric TypeStringpredefined
Numeric TypeIntegerpredefined
(truncate decimal places)
Numeric TypeRealpredefined
Numeric Type
(with Time value format)
Datepredefined
(scale up or down to match time units, truncate decimal places)
Numeric Type
(with Time value format)
Timestamppredefined
(scale up to match time units, truncate decimal places)
StringNumeric Typepredefined
(error if not real or out of range, truncate to maximum decimal places)
IntegerNumeric Typepredefined
(error if out of range)
RealNumeric Typepredefined
(error if out of range, truncate to maximum decimal places)
DateNumeric Type
(with Time value format)
predefined
(error if out of range, scale up or down to match time units)
TimestampNumeric Type
(with Time value format)
predefined
(error if out of range, scale down to match time units)
Arbitrary ID TypeStringpredefined
Arbitrary ID TypeIntegerpredefined
StringArbitrary ID Typepredefined
(error if not integer or out of range)
IntegerArbitrary ID Typepredefined
(error if out of range)
Arbitrary_IDArbitrary_IDpredefined
Object Instance TypeObject Instance Typecounterpart mapping
(error if no counterpart and mapping not conditional)
Event Instance Type
(for solicit event parameter of request wormhole)
Transfer Vector Type
(for event data item or input parameter of control reception point)
predefined
Transfer Vector Type
(for self parameter of asynchronous return wormhole)
Event Instance Type
(for self parameter of asynchronous return mapping)
predefined
Data TypeExternal Typepredefined
External TypeData Typepredefined
(error if actual type not target type)
Data TypeData Typeuser-defined
(error if no return value and mapping not conditional)

Tuesday, 26 May 2009

Week 21 of 2009

First off, my week numbers seems to be off my one. This weekly report covers the previous two weeks which are actually week 20 and week 21 (not week 21/22). I can't go back and change the previous weekly report headings since I will break any cross references to those weekly reports.

I have been working on Action Language syntax and semantics, trying to nail down a sufficient but minimal Action Language for use in OOA09. I've been trying not to rush decisions here since I will have to live with these choices for the foreseeable future. One area in particular that I have been trying to nail down relates to wormholes and bridge mappings. To this end, I wrote a number of recursive design technical notes describing synchronous and asynchronous communications across bridges:

These notes took most of last week since they forced me to clarify a number of important issues, e.g. what happens when return coordinates and transfer vectors go out of scope.

I also realized that watchpoint mappings (object created mappings, object deleted mappings, object updated mappings, event generated mappings and operation invoked mappings) would not be sufficiently flexible. I would also need to allow reflexive bridges in certain situations. The problem here is the assumption that a watchpoint mapping involves two domains. It really involves one or more domains. Therefore, I am replacing watchpoint mappings with domain observers (object created observers, object deleted observers, object updated observers, event generated observers and operation invoked observers). These will be defined on domains rather than bridges but will have access to all domains used in the enclosing project. This will also eliminate the need for reflexive bridges.

Sunday, 24 May 2009

Asynchronous Communications between Domains

This technical note should be read after Synchronous Communications between Domains since I have tried to avoid repeating myself too much here. Most asynchronous communications between domains involve:

  • request wormholes (domain-crossing events or bridging processes) in client domains,
  • control reception points (external events or synchronous services) in server domains,
  • and request mappings in bridges.
However, asynchronous communications may also involve:
  • solicit event parameters on request wormholes,
  • asynchronous return wormholes in server domains,
  • asynchronous return mappings in bridges,
  • and transfer vector types.

Request wormholes are associated with a terminator in a client domain and include domain-crossing events and bridging processes. A domain-crossing event may have any number of carried data items. A bridging process may have any number of user-defined input or output parameters. However, output parameters are not relevant here when dealing with asynchronous communications. Bridging processes are normally used for synchronous communication. However, they may also be used for asynchronous communication as long as a synchronous return mapping exists.

Control reception points are associated with a terminator in a server domain and include external events and synchronous services. External events indicate internal events (state model, domain-crossing or polymorphic events) that can arrive from outside a given domain via a specific terminator. Events may have any number of carried data items. Synchronous services may have any number of user-defined input or output parameters. However, output parameters are not relevant here when dealing with asynchronous communications. Unlike bridging processes, synchronous services may be used in a purely asynchronous manner since the results may not be required by a particular client domain. Dummy return coordinates are passed to synchronous services when they are invoked asynchronously allowing the server domain to execute a dummy synchronous return unaware that it has been invoked asynchronously.

A request mapping in a client-server bridge is implemented using an Action Language statement block. It maps a request wormhole to a control reception point. If the request wormhole is a domain-crossing event then the carried data items are passed as input parameters into the request mapping. Otherwise, the input parameters of the bridging process are passed into the request mapping. Request mappings have no output parameters. The code in a request mapping must either generate the associated external event or invoke the associated synchronous service. It may also decide to do neither without consequence. Output parameters should not be accessed when invoking a synchronous service asynchronously. Any attempt to do so is a static coding error. There may be any number of request mappings for a given request wormhole.

External events may be both unsolicited and solicited. Request mappings to external events define unsolicited events which either represent a new thread of control within the server domain or extend the existing thread of control associated with the client domain's request wormhole. Solicited events within a client domain on the other hand extend an existing thread of control associated with a previously invoked request wormhole to a server domain. Solicited events are defined using solicit event parameters on request wormholes. A request wormhole (whether used synchronously or asynchronously) may have zero to many solicit event parameters. A solicit event parameter holds a complete event instance created in a client domain which is then passed to a server domain as a transfer vector. The transfer vector can then be used to invoke an asynchronous return wormhole in the server domain which as a consequence generates a solicited event in the client domain.

[Wormhole96] proposed that transfer vectors should encapsulate partial event instances with all event data items determined from asynchronous return wormhole input parameters. OOA09 doesn't allow partial event instances at all. It does allow an event instance to be created from another event instance allowing new event data item values to be supplied. It also allows event data items to be read from an event instance in the same way as attributes can be read from an object instance. This allows full or partial overriding of event data items on event instances. However, this always involves creating a new event instance since event instances are immutable in OOA09.

Solicited event parameters have a multiplicity and conditionality providing some indication as to how many solicited events are expected by the client domain. If more than one solicited event is generated when no more than one was expected then an error should be reported but the solicited event is still generated. If no solicited events are generated but at least one was expected and all transfer vectors go out of scope then an error should be reported. A solicited event is not automatically generated here. This behaviour differs from what happens when all return coordinates go out of scope and a synchronous return hasn't been invoked. This is because a missing asynchronous return is a protocol error which should be handled in the appropriate state models while a missing synchronous return is a permanently blocked concurrent thread.

An asynchronous return wormhole is an abstract process associated with a terminator in a server domain which may be invoked in any composed operation (action or synchronous service). It may have any number of user-defined input parameters. Asynchronous return wormholes have no output parameters. A self parameter with a transfer vector type is also automatically defined. However, explicit asynchronous return wormholes are not always required in OOA09 since transfer vectors may arrive in a domain in a complete state allowing a solicited event to be immediately generated without involving an asynchronous return mapping.

An asynchronous return wormhole is normally invoked on a transfer vector value using an invoke return statement, e.g.

transfer_vector.return(message:"Hello World");
However, an implicit asynchronous return wormhole involving a complete transfer vector (one not associated with an asynchronous return wormhole) is always invoked using an ordinary generate statement, e.g.
generate transfer_vector;
The generate statement is used in this case since an asynchronous return mapping is never involved, i.e. the transfer vector's event instance is immediately generated (or delayed if a delay clause is used).

An asynchronous return mapping in a client-server bridge is implemented using an Action Language statement block. It maps an asynchronous return wormhole to a solicited event parameter. It is invoked whenever an asynchronous return is performed using a partial transfer vector. No asynchronous return mappings are required (or possible) for complete transfer vectors. The input parameters associated with a asynchronous return mapping match the input parameters of the asynchronous return wormhole. Asynchronous return mappings have no output parameters. A self parameter with an event instance type is also automatically defined. The self parameter contains the event instance wrapped by the asynchronous return wormhole's transfer vector. It can be used immediately to generate a solicited event. However, some adjustment will normally be required using the input parameters. Any adjustment will involve creating a new event instance. The code in an asynchronous return mapping will normally generate the associated external event. However, it is not required to do so. If there are no asynchronous return mappings for an explicit asynchronous return wormhole then the partial transfer vector is treated like a complete transfer vector, i.e. a solicited event is automatically generated from the transfer vector's wrapped event instance. However, this should be reported as an error. This behaviour differs from what happens when no synchronous return mapping is specified. If you don't want an asynchronous return then you shouldn't pass a transfer vector into a control reception point.

A predefined partial transfer vector type is defined for each asynchronous return wormhole allowing partial transfer vectors to be safely passed around within a domain since the parameters associated with a partial transfer vector can be statically determined within Action Language code. A single predefined complete transfer vector type is also defined allowing solicited events to be generated without the need for an explicit asynchronous return wormhole or an asynchronous return mapping. The predefined complete transfer vector type is generic. The predefined partial transfer vector types are partially generic in that they can be used across multiple control reception points.

Monday, 18 May 2009

Synchronous Communications between Domains

All bridges between domains allow communications in both directions. Even though the domains being bridging are labelled as either client or server. Those roles may be reversed for a given communication. Explicit communications between domains are known as wormholes in Shlaer-Mellor OOA/RD. Wormholes were introduced in OOA96 and later defined in [Wormhole96] as an alternative to domain-crossing events and bridging processes. However, OOA09 integrates these concepts together to gain benefits from both approaches. All synchronous communications between domains involve:

  • bridging processes (request wormholes) in client domains,
  • synchronous services in server domains,
  • request mappings in bridges,
  • synchronous return wormholes in server domains,
  • synchronous return mappings in bridges,
  • and return coordinate types.

A bridging process is an abstract process associated with a terminator in a client domain which may be invoked in any composed operation (action or synchronous service). It may have any number of user-defined input and output parameters. A thread of control passes from one domain to another when a bridging process is invoked. A synchronous return must be invoked by a server domain to continue the original thread of control. Whether processing can still occur within the client domain while waiting for a synchronous return depends on how many concurrent threads have been allocated to the client domain.

A synchronous service (as defined in [SyncServ96]) is a composed operation implemented using an Action Language statement block or a process model. It is associated with a terminator in a server domain. It may have any number of user-defined input and output parameters. A special Return Coordinate parameter is also defined automatically. This parameter is required to invoke a synchronous return wormhole. Return coordinates can be passed on within the server domain as event data items or ordinary parameters and stored as attributes. However, they should not be stored for long since the client domain is waiting for a result. They can also be passed to other domains as external values. However, they can't be used to invoke synchronous returns in other domains.

A request mapping in a client-server bridge is implemented using an Action Language statement block. It maps a request wormhole (domain-crossing event or bridging process) to a control reception point (external event or synchronous service). A synchronous communication always requires a bridging process and a synchronous service. If a domain-crossing event is mapped to a synchronous service then any synchronous returns will be ignored. If a bridging process is mapped to an external event then no synchronous return is possible since new return coordinates are not passed to external events. However, it is still possible to carry an existing return coordinate via an event. The input parameters associated with a request mapping match the input parameters associated with the bridging process. Request mappings have no output parameters. The code in a request mapping must invoke the synchronous service converting bridging process input parameters to synchronous service input parameters.

There may be any number of request mappings for a given bridging process. However, only one synchronous return can be used to satisfy a given invocation. OOA09 allows multiple request mappings, all of which may invoke a synchronous return. Only the first response will be used to satisfy the request. Any additional responses will be ignored. Whether it is good design practice to allow multiple responses here is open to debate. If all return coordinates associated with the synchronous services invoked in response to a bridging request go out of scope then the bridging process invocation can terminate. If all output parameters associated with the bridging process are conditional or have default values then this is a recoverable error that should be flagged but is otherwise acceptable. If there are any mandatory output parameters without default values then this is a fatal error with serious consequences since the original thread of control can't continue. All such fatal errors can be eliminated from deployed systems by ensuring that all bridging process output parameters are either conditional or have a default value. A software architecture may place time limits or other restrictions on bridging processes as long as a default synchronous return is possible, e.g. a software architecture may break a deadlock by invoking default synchronous returns on deadlocked synchronous communications.

A synchronous return wormhole is an abstract process associated with a synchronous service (and as a consequence a terminator) in a server domain which may be invoked in any composed operation (action or synchronous service). The input parameters are automatically determined from the output parameters of the associated synchronous service. Synchronous return wormholes have no output parameters. A self parameter with a return coordinate type is also automatically defined. However, explicit synchronous return wormholes are not actually required in OOA09 since synchronous return mappings and return coordinate types are associated directly with synchronous services rather than synchronous return wormholes. The only benefit of an explicit synchronous return wormhole is that it can be labelled and shown separately on process models.

A synchronous return wormhole is normally invoked on a return coordinate value using an invoke return statement, e.g.

return_coordinate.return(message:"Hello World");
However, within a synchronous service statement block, a synchronous return wormhole can also be invoked using an ordinary non-empty return statement, e.g.
return message:"Hello World";
An empty return statement can't be used for this purpose even if there are no output parameters.

A synchronous return mapping in a client-server bridge is implemented using an Action Language statement block. It maps a synchronous service to a bridging process. It is invoked whenever an explicit or implicit synchronous return occurs. The input parameters associated with a synchronous return mapping match the output parameters of the synchronous service while the output parameters match the output parameters of the bridging process. The code in a synchronous return mapping must convert the synchronous service output values to bridging process output values. If there are no synchronous return mappings for a synchronous service then any synchronous returns will simply be ignored.

A predefined return coordinate type is defined for each synchronous service allowing return coordinates to be safely passed around within a domain since the parameters associated with a return coordinate can be statically determined within Action Language code. There is no generic return coordinate type in OOA09 as a consequence. However, that does not mean that return coordinates can't be passed to a service domain as external values since any return coordinates must be passed back to their server domains (requiring type verification) before they can be used.

Monday, 11 May 2009

Week 19/20 of 2009

I didn't have much to report last week since I was mostly doing behind the scenes coding for OOA Tool. This week I returned to the Action Language. The first step was to revisit the syntax grammar for OAL since I want the Action Language for OOA09 to be backwards compatible where possible. The second step was to update the syntax grammar for the OOA09 Action Language. The third step is to update the overview documentation which hasn't been uploaded yet. Later steps include updating the parser in OOA Tool, implementing an interpreter and debugging interface, and updating the Action Language Subsystem for the OOA of OOA. Only the first two steps will be discussed here. The general overview should be uploaded in the coming week and the other work will completed later.

There are three documents that define the Object Action Language (OAL) from Mentor Graphics:

  • BPAL97 which defines the Action Language in BridgePoint 4.2,
  • OAL02 for later versions of BridgePoint,
  • and OAL08 for the latest version of BridgePoint UML Suite.
OAL has undergone very few changes over the last 10 years. One could say the same for the Action Specification Language (ASL) from Kennedy Carter. However, As I have said before, I prefer the simplicity of OAL. I updated the OAL syntax grammar in the BridgePoint 4.2 Model to handle BPAL97, OAL02 and aspects of OAL08 with other aspects mentioned in embedded comments. The only aspect of OAL08 which has not been captured is the new send statement relating to components and interfaces. The OAL syntax grammar is given below:
Syntax and Lexical Rules for Action Language

The OOA09 Action Language is currently captured as part of the OOA Tool Model. However, it will shortly be put under change control in the same way as the OOA of OOA and OOA Interchange Format are under change control. The OOA09 syntax grammar is given below:

Syntax and Lexical Rules for Action Language

OOA09 adds a small number of new statements:

  • a declare statement,
  • a switch control structure statement,
  • a reclassify object instance statement,
  • and a delete event instance statement.
There are numerous other changes but I will only discuss the new statements above today. The other changes will be discussed in detail in the Action Language overview which should get uploaded in the coming week.

The declare statement allows stronger and weaker type checking. Variables can still be implicitly declared using assignment statements etc. However, users can now declare variables explicitly using predefined types or user defined types from their model. New data types can't be (and don't need to be) defined within Action Language code. All implicit variable declarations can now be replaced with explicit declarations if needed. The declare statement also allows transient non-object instance sequences and sets to be specified since multiplicity is associated with data items (e.g. variables) in OOA09.

The switch statement allows enumerated types to be used safely (including current_subtype and current_state information) since all legal values must be handled as cases. If new legal values are added or old ones are removed then all associated switch statements will need to be updated. Java and C++ switch statements cover up errors far too easily.

The reclassify object instance statement enables users to drop explicit creation and deletion of non-leaf object instances and subtype-supertype relationships. Non-leaf object instance creation will be disabled by default in OOA Tool. However, for backwards compatibility with OAL, users will be able to create non-leaf object instances but if they do so they will need to create all non-leaf object instances and will need to relate and unrelate all subtype-supertype relationships.

The delete event instance statement is part of the delayed event support added to OOA09. Event instances can be created and stored and later turned into generated event instances which may be given a delay when generated. Rather than add the cancel statement (specified in xtUML02) which only cancels a single generated event instance. OOA09 cancels all generated but delayed event instances associated with a specific event instance when it is explicitly deleted. However, OOA Tool will also support the complete Timer interface defined in BridgePoint for backwards compatibility.

On a final note, I came across the ModelDriven.org Portal which includes a downloadable Foundational UML (fUML) Reference Implementation. Like OOA Tool, it's written in Java and requires Java SE 6 or later. I haven't explored it yet.