Create a Reusable Service
You will learn
- How to write an entity definition
- How to use some use generic CAP artifacts like aspects and types
- What associations and compositions are
- How to deploy to a SQLite database
- How to make the project reusable
The previous tutorial was about quickly setting up a working CAP application and read/write some mock data. This tutorial is about learning how to extend the application to a complete products service.
You’ll take advantage of all the out-of-the-box features provided by the CAP Java SDK such as using SQLite as a database for local development. As a result, you’ll remove your custom handlers written in the first tutorial. In subsequent tutorials you will swap out SQLite with the SAP HANA service, when preparing your application for the cloud.
Congratulations! You have successfully developed the products service application, which is based on a CDS domain model and service definition.
In the next tutorial, you will build a bookstore application, reusing the products service application. You will later extend the bookstore application with custom business logic and deploy it to the cloud, using SAP HANA as the database.
-
Step 1: Define the domain model
-
Step 2: Understand keywords
-
Step 3: Get more information about @sap/cds/common
-
Step 4: Rewrite the AdminService
-
Step 5: Deploy the domain model
-
Step 6: Configure CAP application to use SQLite database
-
Step 7: Use CAP's generic persistence handling
-
Step 8: Run and test your application
-
Step 9: Set up for reuse
- Back to Top