The AdminService implemented in our scenario so far exposes the underlying data model in a 1:1 fashion. Such services are rather rare. Instead, services often expose denormalized views that are tailored to specific use cases. Let's take a look at an example in the following.
We model a CatalogService that exposes books and authors from the domain model for use in a bookstore application. In other words, this service is intended to enable catalog users to access books and their authors and to place orders.
The new service that we are now creating is also defined in the srv folder of the CAP project. We use the cat-service.cds file for this (see following figure).

First, we proceed in exactly the same way as with the AdminService: We import all definitions with the namespace prefix com.sap.learning from the file db/schema.cds and set the local alias db for the imported definitions (line 1).
Lines 3 to 31 then contain a service block that defines a service interface called CatalogService as a collection of exposed entities. The @path annotation is used to specify the URL path /cat under which the service will be accessible.
The CatalogService exposes two entities that are defined as projections on entities from the underlying domain model. Lines 5ff declare an entity called Books, which is a view on the Books entity defined in the imported domain model. Accordingly, an Authors entity is declared in lines 18ff as a projection on the Authors entity from the domain model.
We will look at the Authors entity in the CatalogService in more detail later. First, let's take a closer look at the Books entity.
In contrast to the Books entity in the AdminService, which exposes the underlying domain entity in a 1:1 fashion, the Books entity in the CatalogService uses an explicit select clause. This means that only what is explicitly listed in the select clause is exposed.
So-called path expressions can be used in the select clause to navigate along associations and/or structured elements.
In the example shown, the author association of the Books model entity is used to access the author's name and this is included in the select clause as writer.
Also publCountry is an association defined on the Books model entity. It is used to relate the Books entity to the sap.common.Countries code list. In the example, the country name from this code list is included in the select clause as publCountry.
The price element of the Books domain entity has a structured type. The two components amount and currency of this type are also included in the select clause via corresponding path expressions.