Kennedy Carter
Go
  |  Contact us
PRODUCTS - Code Generation :: Java Code Generators :: TA-10 Code Generator

TA-10 generates a single-threaded, asynchronous, nonpersistent Java task. It transforms platform-independent iUML models into platform- specific Java Micro Edition (ME) and Java Standard Edition (SE) implementations.

Java ME is the platform for small devices, which range in size from pagers and mobile phones to set-top boxes and car navigation systems, and Java SE is the original and most widely used platform for developing general purpose desktop applications.

Example Code Production

With TA-10, this platform independent Action Language:

 

is translated into this target Java Code:

Note that the original Action Language code is rendered as Java comments in the target code to aid the readability.

Java ME Platform

The TA-10 code generator automatically generates the necessary code to start, pause and destroy MIDP applications (MIDlets) in accordance with the MIDP profile.

TA-10 supports version 1.1 of the CLDC configuration and version 2.0 of the MIDP profile.

Threads

TA-10 applications are designed to run in a single Java thread. However, this does not preclude them from being part of much larger multi-threaded applications. In fact, it is quite common for applications to comprise part-generated, part-external (possibly legacy) code, and for the external code to run in its own threads.

In hybrid applications such as these, the safe way for external code to communicate with generated code is via UML signals.

Signals & Signal Queues

TA-10 is an asynchronous architecture because the UML signals which it processes are not delivered to their recipients as soon as they are generated. Instead, they are placed in a queue and delivered some time later, along with any parameters that they may be carrying.

TA-10 supports multiple UML signal queues to enable signals to be prioritised and hence models to be constructed which respond in a timely manner to external stimuli.

During model construction, signals are assigned priorities by attaching priorities to the classes which own them. A high-priority class will receive its signals before a low priority class.

Execution Modes

TA-10 supports both interleaved and sequential modes of execution.

In interleaved mode, the processing of external signals is interleaved with that of internal signals. In sequential mode, the processing of internal signals always precedes that of external signals. An external stimulus is therefore always processed to completion before the next external stimulus is processed.

A model that is designed to run in sequential mode is normally simpler to construct than one that is designed to run in interleaved mode, because it does not have to account for external signals arriving during the processing of internal signals.

Timers

TA-10 supports xUML timers.

Persistence

Modellers can implement persistence by making use of the MIDP functions for managing non-volatile memory. This only applies to Java ME applications.

Mapping Rules

Mapping rules define the relationship between the source xUML models and the generated code. These rules are encoded in the TA-10 code generator which is itself built using iCCG. Users of the Adaptable version of TA-10 can change these mapping rules as desired.

Examples of some mapping rules are shown below.

Structural mapping rules define the rules for mapping structural elements like domains, classes, operations etc to the target platform. For example, this is part of the rule for mapping a class.

comment-box

package domain-package;

import kc.ta10.run.*;

import kc.ta10.type.*;

import kc.ta10.util.*;

if debug is enabled:

import kc.ta10.debug.*;

for each deferred data type:

import deferred-data-type-tag;

public class class-class extends ... {

// Attributes

for each attriute whose data type is not deferred:

public attribute-type attribute-name;

Actionable mapping rules define the rules for mapping ASL statements. For example, this is part of the rule for mapping ASL create statements.

handle = create class with attribute = attribute-value & ...

---

V(handle) = Q(class-class).create_object( E(attribute-value)

for each identifying attribute, with separator

);

V(handle).attribute-name =

E(attribute-value);

for each non-identifying attribute, except 'current state'

V(handle).current_state_mr = Q(state-class);

if the attribute is 'current state'

V(handle).current_state_mr = this;

if the create statement is in a creation state of the class of object being created and the 'current state' attribute is not assigned

Variants

TA-10 is available in portable and adaptable variants.

The portable variant applies a fixed set of mapping rules for transforming iUML models to Java.

The adaptable variant applies a set of mapping rules which can be changed to meet the needs of particular projects or organisations. The adaptable variant comes with full source code.