Skip to Content
0
Dec 14, 2022 at 02:42 PM

CAP: Consuming services in a monorepo

398 Views

Hello,

how does service consumption work in a monorepo environment? Consider, for instance, the example repository cloud-cap-samples and the 'app' bookstore. Bookstore consumes/mashes up multiple services: bookshop, reviews, orders etc. . Are those consumed services considered to be remote services? In other words, would the query

GET /Books?$expand=reviews

be automatically resvoled by CAP in a deployed environment (cloud) or is a custom implementation required as described in the documentation?

Background: I'd like to use a monorepo for multiple connected apps building on each other. Apps may have entities that have associations/compositions to entities in other apps. I'd like to have CAP resolve expands and navigations automatically as done in a monolith app. However, as far as I understand it, I would have to implement each expand manually because the entities from other apps are considered to be remote entities.

If that is the case, is there a way to circumvent this or am I stuck with a monolithic approach?

Related questions:

- CAP Java: Several small CAP projects vs. one big CAP project

- How to create a reuse service with a custom handler in CAP Java?