Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ConstructRuntime instance structures

EClass

Has a name and can be abstract (cannot be instantiated) and interface (purely API). A container of so-called structural features (attributes and associations).

Example:

PlantUML Macro
class OrgUnit
class Person

Non-abstract classes can be instantiated. Instances will have attributes values and links to other objects corresponding to contained and inherited features.

 

PlantUML Macro
object "~#o1 : OrgUnit" as o1
object "~#p1 : Person" as p1

EDataType

A non-modelled or "foreign" type, provided by the host language and runtime environment, like int, double, String, Date etc. Many such types are pre-defined by Ecore, e.g. EInt, EIntegerObject, EDouble, EDoubleObject, EBoolean, EBooleanObject, EString, EDate corresponding to Java's int, Integer, double, Double, boolean, Boolean, String and Date types. You can define your own, to be able to use other Java types in your model.

Instances of the corresponding (non-abstract) Java classes can be created from Strings.

EClassifier

Abstract superclass of EClass and EDataType

 

EAttribute

Has a name, type (an EDataType) and multiplicity (lower and upper bounds).

 

PlantUML Macro
class OrgUnit {
	String name
}
class Person {
	String name
}

PlantUML Macro
object "~#o1: OrgUnit" as o1 {
	name = "IDI"
}
object "~#p1: Person" as p1 {
	name = "Hallvard"
}

EReference

Has a name, type (an EClass) and multiplicity. Corresponds to a one-way/directed association from the owning EClass to another EClass.

 

PlantUML Macro
class OrgUnit {
}
class Person {
}
OrgUnit <- Person: works-in

PlantUML Macro
object "~#o1: OrgUnit" as o1 {
	name = "IDI"
}
object "~#p1: Person" as p1 {
	name = "Hallvard"
}
o1 <- p1: works-in

Two EReferences may be each other's opposite, meaning that of one instance refers to the other, the other must refer back.

 

PlantUML Macro
class OrgUnit {
}
class Person {
}
OrgUnit -> "*" Person: workers
OrgUnit <- Person: works-in
PlantUML Macro
class OrgUnit {
}
class Person {
}
OrgUnit "works-in" <--> "workers *" Person

PlantUML Macro
object "~#o1: OrgUnit" as o1 {
	name = "IDI"
}
object "~#p1: Person" as p1 {
	name = "Hallvard"
}
object "~#p2: Person" as p2 {
	name = "Letizia"
}
o1 <-- p1: works-in
o1 --> p1: workers
o1 <-- p2: works-in
o1 --> p2: workers

EStructualFeature

Abstract superclass of EAttribute and EReference. The distinction between these two is the kind of type they have, EDataType and EClassifier, respectively.

Instances will have fields constrained to the type of the attribute, either the type itself or a list of that type.
Operation 

...