CDS & data modelling

Composition (CDS / RAP)

What it is

A special CDS association expressing ownership: the child entity is part of the parent and has no life of its own. RAP uses compositions to define a business object's hierarchy (root → child), driving cascading create/delete and draft.

Why it matters for Clean Core

Compositions define the consistency boundary of a RAP BO. The framework cascades lock, draft and authorisation along the composition tree, so getting the composition structure right is getting the BO right.

Common pitfall

Modelling a child that should be independent as a composition (or vice versa). A composition means 'deleting the parent deletes me' — use it only for true part-of relationships, not for every foreign key.

Learn it in the DojoAssociations & compositionsCDS for RAP — View Entities, Associations & Annotations

Related terms