Ticket #786 (closed Enhancement: fixed)

Opened 9 years ago

Last modified 9 years ago

Core API: topic references should be supported for Compositions as well

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.6
Component: DeepaMehta Standard Distribution Version: 4.5
Keywords: Cc: dgf, Malte
Complexity: 3 Area: Application Framework / API
Module: deepamehta-core


Currently a Topic Reference to a child topic is only functional in conjunction with Aggregation Definition. This design reflects the fact that with Compositions in contrast the child topic can't be exist independently from the parent. That's the very definition of Composition. So, conceptually it seemed contradictory to refer to a child, which, at this moment, apparently exists already independent from the parent.

However, technically there are situations when the child exists already, also for Compositions. So the Core should support Topic References also in conjunction with Composition Definition.

Note: Topic Reference here refers to 1) the ChildTopics's setRef() method and the TopicReferenceModel class (Core API), and 2) the ref_id: and ref_uri: prefixes (REST API).

Change History

comment:1 Changed 9 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Jörg Richter <jri@…>

In 1d5fcb22f34549cb88579fd9359c42ce7f4985f3/deepamehta:

Core API: Compositions support topic refs (#786).

When updating child topics a Topic Reference can also be used for childs which have an underlying Composition Definition. (Formerly topic references were only supported in conjunction with Aggregation Definition.)

This widens the usage context of the following APIs:

Core API:

  • ChildTopicModel's putRef() and addRef() methods
  • ChildTopic's setRef() and addRef() methods


  • The ref_id: and ref_uri: prefixes used in update requests

Note: when a topic reference appears in an operation for updating childs defined as "Composition One" the formerly assigned child topic (if there is one) is deleted. In contrast a child defined as "Aggregation One" is not deleted in that case but only the assignment (=association) is. This reflects the fact that a "compositioned" child can't exist without a parent relationship. An "aggregated" child in contrast can.

See #786.

comment:3 Changed 9 years ago by Jörg Richter <jri@…>

In 88da9ea6a324a5b16d89f0d50afae7d05580a2e7/deepamehta:

Core fix: create composition child via ref (#786).

Topic References for child topics defined via Composition Definition can be used in create operations as well (not only in update operations).

See #786.

comment:4 Changed 9 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.