SAP_CAPbeginner
CDS domain modeling
Define entities keys associations compositions and reusable aspects
Overview
Define entities keys associations compositions and reusable aspects
Lessons in this topic
- SAP CAP Localization: i18n Bundles, Localized Data and Language FallbackInternationalize CAP UI/service labels without hard-coding translations or exposing cross-locale data. CAP supports language-specific text bundles and modeling localized data. Translating static labels, text records and currency/number formatting are different responsibilities. The accepted locale may come from HTTP
- CDS domain modeling — SAP Guided TutorialModeling entities, keys, associations and compositions in CDS: when a child belongs to its parent (composition) versus merely references it (association), and how reuse aspects like cuid and managed keep the model consistent.
Interview questions covered
- Explain the difference between an association and a composition in CDS, with an example.
- How do you design keys for a CAP domain model, and when would you not use UUIDs?
- A project team asks you to implement this requirement: Internationalize CAP UI/service labels without hard-coding translations or exposing cross-locale data. Explain setup, version boundaries, validation, production failure handling and release controls.
How to study CDS domain modeling
CDS domain modeling has 2 lessons (1 intermediate, 1 beginner) with about 13 minutes of reading in total. Start with the lesson that matches your level, then read the real project scenario and common mistakes in each one before moving on. After the lessons, say the 3 interview questions out loud in your own words, then check yourself against the model answer in each question (shown once you open it). Use the 5 mock questions to check recall.
Mock test questions covered
Try answering each one before you open the mock test; the answer options and scoring are in the Mock Questions tab.
- What should remain unchanged when a CAP service uses a different language?
- Order items should be created, read and deleted together with their order. How should they be modeled?
- What does the `managed` aspect from @sap/cds/common add to an entity?
- A developer wants the database to reject orders pointing to non-existent customers when they are written via the service. Which is the declarative CAP option?
- A managed to-one association `author : Association to Authors;` is defined on Books. What appears in the database table?