Skip to content

Supported reference targets #57

Description

@enikao

supported: Arbitary targets

LIonWeb supports referencing arbitary other nodes (assuming they match the declared type of the reference)

Example:

concept Car
  reference drivesOn: Street[1]

concept Town
  containment streets: Street[0..*]

concept Street

supported: Own parent as target

LIonWeb supports referencing the parent of a node.
(Whether it makes sense to design such a reference is not relevant here.)

Example:

concept Town
  containment streets: Street[0..*]

concept Street
  reference locatedIn: Town[1]

supported: Manually maintained bi-directional references

LIonWeb supports referencing A from B and B from A, given that the model user maintains both the links.

Example:

concept LogEntry
  reference event: LogEvent[1]

concept LogEvent
  reference entry: LogEntry[1]

Example usage:

assert myLogEntry.event == null
assert myLogEvent.entry == null
myLogEntry.event = myLogEvent
assert myLogEvent.entry == null
myLogEvent.entry = myLogEntry

assert myLogEntry.event = myLogEvent
assert myLogEvent.entry = myLogEntry

NOT supported: automatic bi-directional references

LIonWeb does not support bi-directional references in the sense that changing one end automatically updates the other.

Example:

// NOT possible in LIonWeb
concept LogEntry
  reference event: LogEvent[1]   inverse entry

concept LogEvent
  reference entry: LogEntry[1]   inverse event

Example usage:

// NOT possible in LIonWeb
assert myLogEntry.event == null
assert myLogEvent.entry == null
myLogEntry.event = myLogEvent
assert myLogEvent.entry == myLogEntry

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions