Virtual Data Model for oData APIs – That’s in for you as a developer with SAP Cl...
source link: https://blogs.sap.com/2023/01/16/virtual-data-model-for-odata-apis-thats-in-for-you-as-a-developer-with-sap-cloud-sdk-javascript/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Virtual Data Model for oData APIs – That’s in for you as a developer with SAP Cloud SDK (javascript)
Introduction
What’s a Virtual Data Modell
And why do we want to use it?
-
You will write less code (boilerplate)
-
You will speed up your implementation (due to existing types)
-
You will get warnings (e.g. for typos) while implementation / dev-time instead of while run-time
-
It’s easy to generate these VDMs / type-safe clients by using EDMX (Metadata) files (or swagger files)
Enough text, show me what’s in for me – Let’s focus on that “type-safe” thing …
More efforts please
public async getCompanySuppliersAxios(companyCode: string):Promise<any>{
public async getCompanySuppliers(companyCode: string):Promise<Array<vdmBuPa.SupplierCompany>>{
How to start using SAP Cloud SDK?
-
Easy access to BTP services (most common: The BTP Destination Service; provide out-of-the-box support of destinations saved on the service and bound to the application)
-
Generate VDM type-safe clients for your oData API by using the EDMX / Metadata from the API within the EDMX-Generator
-
Generate VDM type-safe clients as well for openAPIs. Use a SWAGGER file within the openAPI-Generator to do so
-
Implement your first application within a VDM by following a tutorial (e.g. the Address-Manager)
-
Check out the “Getting Started” page of the SAP Cloud SDK
Conclusion
Within the Cloud SDK and their adoption of the Virtual Data Model, SAP is providing functionalities and capabilities to us developers to easy use the benefits of structured oData APIs.
In my last project we did set up more then 30 different VDM clients, which we do host on AzureDevOps as Artifacts (if you want so – it’s like a “private npm”). We set up multiple CI/CD pipelines to automatically refresh VDMs if a related oData API got changed. These VDMs did not only point to S/4 HANA systems, they also got used within R/3 onPremise installations and CAP applications running on BTP.
This approach did help and speed up our implementation at the same level, as it did raise the quality of our application portfolio, who is consuming / using these VDMs. We were able to reduce a lot of bug appearances, as issues with oData APIs or type miss matches did appear already while implementation phase.
Based on many different backgrounds of skills, it can be a long and though way down the road to get to know javascript, nodeJs, typescript and the SAP Cloud SDK within VDMs. But it’s worth it: Raising quality, saving time and it does make fun as well
Last but not least – Thanks to the team behind the SDK, I did raise some issues, questions or feature-improvement-ideas on the official github repository and I am really impressed by the speed and quality of responses I do receive.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK