Structure
ATLHelper
Represents an ATL helper function.
struct ATLHelper<BodyExpression> where BodyExpression : ATLExpression
Overview
ATL helpers extend the OCL standard library with custom operations that can be reused across transformation rules and other helpers. They support both contextual helpers (associated with a specific type) and contextual-free helpers (global functions).
Overview
Helpers in ATL serve multiple purposes:
-
Code reuse: Complex expressions can be encapsulated and reused
-
Type extension: New operations can be added to existing types
-
Modularity: Complex transformations can be broken down into manageable functions
-
Testing: Individual helper functions can be tested independently
Example Usage
// Contextual helper for Family!Member
let familyNameHelper = ATLHelper(
name: "familyName",
contextType: "Families!Member",
returnType: "String",
parameters: [],
body: navigationExpression
)
// Context-free helper
let utilityHelper = ATLHelper(
name: "formatName",
contextType: nil,
returnType: "String",
parameters: [firstNameParam, lastNameParam],
body: concatenationExpression
)
Topics
Operators
Initializers
Creates a new ATL helper function.
Instance Properties
The body expression that defines the helper’s computation.
The context type for contextual helpers, or nil for context-free helpers.
The name of the helper function.
The parameters accepted by the helper function.
The return type of the helper function.
Instance Methods
Get hash value for the helper’s identifying properties
Check if two helpers are equal for their identifying properties
Default Implementations
Relationships
Conforms To
See Also
Modules and Rules
Represents an ATL (Atlas Transformation Language) module.
Represents an ATL matched rule for declarative transformation.
Represents an ATL called rule for imperative transformation.