Skip to content

Implementation Role Feature 2

Max Leuthäuser edited this page Nov 18, 2021 · 9 revisions

Title

Roles depend on relationships

Description

Roles are only useful in the context of a relationship.

Implementation

Although there is no mandatory restriction to use relationships between roles or role playing objects in SCROLL one can create them at any time within a Compartment.

E.g.:

val p = new CoreA

new SomeCompartment {
  val rA = new RoleA
  val rB = new RoleB
  val rC = new RoleC
  
  p play rA
  p play rB

  val rel1 = Relationship("rel1").from[RoleA](1).to[RoleB](1)
  val rel2 = Relationship("rel2").from[RoleA](1).to[RoleC](1)
  // ...
}

(From: RelationshipTest.scala)

Additional hints

Different types of multiplicities are supported. See Relationships.scala.

Clone this wiki locally