{"ref":"capability:service-composition","page":"/capabilities/service-composition","json":"/capabilities/service-composition.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"service-composition","name":"Service composition","domain":"integration-and-messaging","ecosystems":["cap"],"universal":true,"description":"Building one solution out of parts other projects published: a reuse package brings its models, code, initial data and texts into your project through npm or Maven, you serve what you reference and extend what you import, and the same modules deploy as one application or as several on a shared database. Distinct from [service integration](capability:service-integration), which reaches a service that stays deployed elsewhere, and from [tenant extensibility](capability:tenant-extensibility), which is a subscriber extending a running SaaS.","short":"Building one solution from reuse packages other projects published","core_coverage":{"state":"core-only","assessed_at":"2026-09-27","what_core_does":"Built in: `npm add` or a Maven dependency embeds a reuse package's models, service definitions, implementations, i18n bundles and initial data in the project; what the project's own models reference is served and the rest is ignored; an imported definition can be extended and its implementation replaced with `@impl`; a package's `index.cds` is its entry point, and `cds pull` and `cds push` apply the same techniques to a subscribed SaaS application. The modules of one solution deploy as a monolith, as applications on a shared database or as separate deployment units by configuration, which the Microservices guide calls a late cut. [@sap/cds-common-content](artifact:sap-cds-common-content) is SAP's own business data package for the common countries, currencies, languages and timezones.","where_it_stops":"At the package boundary. Which definitions a reuse package exposes is a convention, an `index.cds`, and not a mechanism; a shared database across applications is a project the guide has you assemble by hand and deploy on its own; and combining data that lives in several databases is federation, read under [replication](capability:replication). Nothing outside the core provides this yet. One sample shows five services reading each other's SAP HANA tables across HDI containers.","sources":[{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"CAP promotes reuse and composition by importing content from reuse packages. Reused content, shared and imported that way, can comprise models, code, initial data, and i18n bundles."},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"By default, when importing reuse packages, all imported content becomes an integral part of your project, it literally becomes embedded in your project."},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"Everything that you are referring to from your own models is served. Everything outside of your models is ignored."},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"You can even extend imported definitions, for example, add elements to imported entities, or add/override annotations, without limitations."},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"In general, every CAP-based product can serve as a reuse package consumed by others."},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"This allows your users to refer to your models in using directives using just the package name"},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"Subscribers of SaaS solutions can use the same reuse and extend techniques to tailor the application to their requirements"},{"url":"https://cap.cloud.sap/docs/guides/integration/reuse-and-compose","title":"CAP Service Composition — capire","checked":"2026-09-27","quote":"When providing your reuse package as a Maven dependency you need to ensure that the CDS, CSV and i18n files are included into the JAR."},{"url":"https://cap.cloud.sap/docs/guides/deploy/microservices","title":"Microservices with CAP — capire","checked":"2026-09-27","quote":"In this way, the same application can be deployed as a monolith, as microservices with a shared database, as true microservices, or a combination of these, just via configuration change."},{"url":"https://cap.cloud.sap/docs/guides/deploy/microservices","title":"Microservices with CAP — capire","checked":"2026-09-27","quote":"In the following steps, we create an additional project to easily collect the relevant models from these projects, and act as a vehicle to deploy these models to SAP HANA in a controlled way."},{"url":"https://cap.cloud.sap/docs/guides/deploy/microservices","title":"Microservices with CAP — capire","checked":"2026-09-27","quote":"When data is distributed across multiple databases, strategies may be necessary to combine data from multiple sources."}]},"history":[{"date":"2026-09-27","field":"id","from":"none","to":"service-composition","reason":"Proposed by the capire audit of 2026-09-27 with medium confidence: importing reuse packages, composing a solution from modules and choosing the deployment cut late is documented in two guides and owned by no capability; tenant-extensibility is per tenant and deployment is topology. Created by the maintainer's decision, with the core's answer read from both guides."}],"drafted_with_ai":true},"sap_delivery":{"door":"cap","all":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"},{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json"}],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:sap-cds-common-content","name":"@sap/cds-common-content","json":"/artifacts/sap-cds-common-content.json"}]},"by_flavor":{"node":{"built_in":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json"}],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:sap-cds-common-content","name":"@sap/cds-common-content","json":"/artifacts/sap-cds-common-content.json"}]},"java":{"built_in":[{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json"}],"documented_pattern":[],"announced":[],"packages":[]}}},"edges":{"use_cases":[],"shared_tasks":[],"related_tasks":[],"options":[{"ref":"artifact:sap-cds","name":"@sap/cds","json":"/artifacts/sap-cds.json","ecosystem":"cap","origin_ring":"sap-official"},{"ref":"artifact:sap-cds-common-content","name":"@sap/cds-common-content","json":"/artifacts/sap-cds-common-content.json","ecosystem":"cap","origin_ring":"sap-official"},{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json","ecosystem":"cap","origin_ring":"sap-official"}],"samples":[{"ref":"artifact:miyasuta-cap-cross-container","name":"cap-cross-container","json":"/artifacts/miyasuta-cap-cross-container.json"},{"ref":"artifact:capire-bookstore","name":"capire/bookstore","json":"/artifacts/capire-bookstore.json"},{"ref":"artifact:capire-xtravels","name":"xtravels","json":"/artifacts/capire-xtravels.json"}],"explained_by":[],"normative_context":[]}}