Core Model Meta Meta-Model

Table of Contents

Overview Core Model

Every meta-model is based on the Actifsource Core Model. Make sure that you understand the concepts of Resource, Class and Property before you start creating your own meta-model.

image77 image77

Resource

In Actifsource everything is a Resource. That means that every Resource you create extends the Resource. Even Resource extends Resource, so that the core model can describe itself.

image78 image78

If the Resource shall has a name you can extend from NamedResource.

image79 image79

Class

Creating your own meta-model you have to specify a set of classes and their relationships. The Core Model therefore provides you a NamedResource called Class. Class is the only Resource in Actifsource that can be instantiated where in this context we mean by instantiate that there is a typeOf relation. For that reason Resource is of type Class and Class extends NamedResource.

This recursive definition becomes necessary as the Actifsource core model has to describe itself. You can say that the Actifsource core model is meta-model of itself.

image80 image80

Property

Any information is modelled by a property. Specifying your own class therefore also means specifying all properties of this class.

image81 image81

There are different types of properties.

image82 image82

Property

The property acts as an abstract base class. Please note that properties are fully typed. In Actifsource the type of a property is named range.

image83 image83

Every resource that can be referenced by a range has to be of type AbstractType. One abstract type you already know by now is Class.

image84 image84

  • SubjectCardinality The Property defines the subject cardinality which determines how many resources of type B can be referenced by a resource of type A via relation b.
    image85 image85
    You may choose one of the following predefined cardinality instances.
    image86 image86
    It is also possible to define any other cardinality just by specifying minCardinality and maxCardinality.
    image87 image87

  • Relation The relation acts as an abstract base class for any relation property between classes.

  • Extends The relation extends allows you to define sub-properties of existing properties in a super class.
    image88 image88
    ASub.bSub extends A.b in the following example. That means that instances of ASub can have only references to resources of type BSub while it is still possible to access the ASub.bSub resources via A.b as type of B
    image89 image89
    It is also possible to have more than one sub-property that extends the same super-property, as long as the sum of cardinalities of the sub-properties complies with the cardinality of the super-property.
    image90 image90
    Please note that is it only allowed to extend a property of the same type (i.e. UseRelation extends UseRelation, Composition extends Composition).

  • ObjectCardinality The Relation defines the object cardinality which determines how many resources of type A can reference a resource of type B via relation b
    image91 image91
    You may choose one of the following predefined cardinality instances.
    image92 image92

UseRelation

The UseRelation (UML: Association) references another resource without affecting the lifetime of this resource. Deleting the referencing resource will not delete the referenced resource.

image93 image93

The range of UseRelation is AbstractType.

image94 image94

  • UseRangeRestrictionAspect You may want to restrict resources that can be referenced by a UseRelation depending on their context. Consider a state machine where only target states of the own state machine shall be selected.
    image95 image95
    Let’s define a UseRangeRestriction aspect for Transition.state that allows only states of the own state machine. Select the ResourceSelectorAspectImplementation for the easy to use Selector-Syntax (see Chapter 9.3.2 SelectorFunction) or the JavaAspectImplementation for a powerful Java implementation.
    image96 image96
    Starting from Transition navigating backwards via transition and state (note the minus sign for backward navigation) to Statemachine where navigating forward to all States.

Composition

The Composition (UML: Aggregation, Composition) aggregates another resource. Deleting the aggregating resource of type A will delete the referenced resources of type B

image97 image97

Please note that you have to adjust the ObjectCardinality if B may be owned either from A1 or A2

image98 image98

The range of Composition is Class.

image99 image99

DecoratingRelation

Combining two existing models together is a very important task. Sometimes this is done by so called model transformation. Actifsource chooses another way, because model transformation often only works in one direction. Actifsource allows decorating existing resources with other ones. That means that we can add any auxiliary information to already existing information. You will find out that this is a very powerful concept.

The DecoratingRelation allows building a homomorphism. A homomorphism is a structure-preserving map between two structures. The word homomorphism comes from the ancient Greek language: ὁμός (homos) meaning "same" and μορφή (morphe) meaning "shape".

Consider a resource A1 with a list b1 of resources of type B1 Consider a second List A2 that has a reference a1 to a resource of type A1 The decorating relation A2.b2 shall have 0..1 resources of type B2 for any resources reached via A2.a1.b1

image100 image100

The decorating relation A2.b2 needs a decorating aspect which defines where to find the resources that shall be decorated.

image101 image101

Let us create a resource TestA1 of type A1 first.

image102 image102

Now let us create a resource TestA2 of type A2 with a reference to TestA1 Please note that A2.b2 is now decorating A2.a1.b1 what is indicated by the brackets (i.e. b1[B1_1]).

image103 image103

Creating a decorated resource will automatically fill in the target property b1

image104 image104

Please note that the decorating relation needs a subclass of type Decorator.

image105 image105

If your decorating relation does not point to a resource which fits the requirements Actifsource comes up with a quick assist (see also Chapter 3.10 Quick Assist).

image106 image106

The quick assist extends the range of the decorating relation from Decorator and adds a sub relation to Decorator.target with type of the target of your decorating aspect.

image107 image107

SelectorRelation

[TBD]

Attribute

The Attribute allows creating simple literals. There are some predefined literal instances that you might use. Please note that the range of an attribute is Literal where Literal is also an AbstractType as already seen for Class (see Chapter 4.4.1 Property).

image108 image108

  • BooleanLiteral The Boolean literal allows the values true or false only.
  • DoubleLiteral The double literal is a 64 bit floating point value.
  • IntegerLiteral The integer literal is a 32 bit integral value.
  • LongLiteral The long literal is a 64 bit integral value.
  • StringLiteral The string literal is a single-line string value.
  • TextLiteral The text literal is a multi-line string value.
  • ScopePathLiteral The scope literal allows referencing any file in the current project.
  • JavaTypeLiteral The Java type literal allows referencing a Java class or interface.
  • JavaClassLiteral The Java type literal allows referencing a Java class.
  • JavaInterfaceLiteral The Java type literal allows referencing a Java interface.

AbstractType

image109 image109

As we have seen before, Class and Literal both extend AbstractType. Furthermore, AbstractLiteral is of type Literal and Resource is of type Class. To complete this picture, we can add Any which is of type AbstractType.

Core Resources

The Actifsource Core provides a set of resources that allows you to build your own meta-model. The most important resources are Class with its Properties and Enum.

ch.actifsource.core.Class

image110 image110

  • typeOf To act as a class a resource has to be of type Class. To be type something of means to be an instance of something.
  • comment The comment text literal let you comment your classes and literals. Comments are shown in tooltips when hovering the mouse pointer over class and property names.
Info

Note that the comment property is inherited by extending from Commentable. Extending from Commentable allows writing comment for any resource and activates the tooltip functionality.

  • aspect[InitializationAspect] The initialization aspect initializes a resource during creation. To be provided as Java class.
  • aspect[ResourceValidationAspect] The resource validation aspect defines specific validation rules for a resource. To be provided as Java class.
  • aspect[NameAspect] The name aspect defines the name of a resource. To be provided as Java class or in the simple selector syntax.
Info

Note that you might define a selector aspect pointing to a TemplateFunction (see Chapter 9.3.6 TemplateFunction) or a TemplateLineFunction (see Chapter 9.3.7 TemplateLineFunction).

  • extends Defines the base class and inherits all properties when instantiating.
  • modifier The modifier defines if a class can be instantiated or sub classed.\
Modifier Description
Abstract No instance allowed of this class.
Final No subclass allowed of this class.
  • property Defines the property of this class. Properties carry the data when instantiating the class. Choose the property type you need (see also Chapter Property).

    image111 image111

  • definesAspect Defines aspects for instances of this class (see also aspect[InitializationAspect], aspect[ResourceValidationAspect], aspect\NameAspect] which are defined in the aspect property of the class Class.

  • allowRoot A Class is a root class if it is not aggregated exclusively (that mean owned by an ownRelation with ObjectCardinality1_1). Set this flag to true or false if you want to overwrite the Actifsource logic.
    Please note that only root classes can be created directly via the New Actifsource Resource Tool (see Chapter 2.9.1 New Actifsource Resource).

  • classIcon Sets an icon for this class and all instances. You can select an icon project by using content assist to browse the current project. The icon size shall be 16 x 16 pixels.

  • lineColor Deprecated.

  • fillColor Deprecated.

  • shape Deprecated.

ch.actifsource.core.Enum

The enum is a class with a set of values.

image112 image112

  • Value Technically the value is an instance of the enum and therefore fully typed.
Info

Note that you might define properties in your enum which are than accessible in the values.

image113 image113