A key benefit of system and software modeling is the ability to explore various design alternatives to reach a fixedpoint representation of a concrete system design. Among a diverse set of configuration possibilities, a model engineer must be able to explo
Figure 1. The model transformation process with the Constraint-Specification Aspect Weaver (C-SAW). Source models and a transformation specification serve as input to a transformation engine that derives new target models.
Type System. In GME terminology, a model is structurally a graph where its elements are the nodes of the graph and the relationships between elements are the edges of the graph. An atom is a model element that can not contain any other model elements. A model may be a container in which there may be a combination of submodels and atoms. Both models and atoms have a set of properties. ECL provides a basic type system to describe values and model objects in a transformation. The data types in ECL include standard primitive data types (e.g., boolean, integer, real and string) and model object types (e.g., atom, model, object and connection) that can reflectively refer to domain concepts specified in the metamodel.
Model selection and aggregation. A common activity during model transformation is to find the elements in a model that may need to be modified. There are two different approaches to locating model elements. The first approach - querying - evaluates a predicate expression over a model, returning those elements of the model for which the expression holds. The other common approach uses pattern matching where a term or a graph pattern containing free variables is matched against the model. ECL supports model queries by providing the select operator and a set of special operators on model aggregations to select a collection of model objects. There are also a set of operators to find a single model object.
The select operator is frequently used in ECL to specify a selection from an existing collection, which can be the result of previous operations and navigations. The result of the select operation is always a subset of the original collection. There are also numerous operators to support model aggregation. For example, models(<expression>) is used to select all the submodels that satisfy the constraint specified by the expression. Other query operators include atoms(<expression>), connections(<expression>) and
A key benefit of system and software modeling is the ability to explore various design alternatives to reach a fixedpoint representation of a concrete system design. Among a diverse set of configuration possibilities, a model engineer must be able to explo
attributes(<expression>). Operators like findAtom and findModel are used to find a single atom or model; source and destination are used to return the source object and the destination object in a connection.
Transformation operations. The primary model transformation operations include adding model objects, removing model objects and changing model object properties. Standard OCL does not provide such capabilities because it does not allow side effects to a model. However, a transformation language should be able to alter the state of a model. ECL extends the standard OCL by providing a series of operators for changing the structure of a model. To add new elements (e.g., a model, atom or connection) to a model, ECL provides such operators as addModel, addAtom and addConnection. Similarly, to remove a model, atom or connection, there are operators like removeModel, removeAtom and removeConnection. To change the value of any attribute of a model element, setAttribute can be used.