Skip to Content

I’m sure you’ve heard or read about the new application programming model for SAP Cloud Platform. And probably already know a little more about Core Data & Services (CDS) and what it has to offer. But do you fully understand how much quicker, easier and more effective it can be to develop an application on SAP Cloud Platform using the new programming model? If not, this quick overview is for you.

1 – It lets you focus on what’s important

The application programming model provides generic, out-of-the-box features that automate time-consuming tasks. For example, admin data and Universally Unique Identifiers (UUID) are automatically completed in your model, there is no need to input the information manually. By providing these features out-of-the-box, we save you the time and trouble. That means you can focus on what is important: your business logic! The business logic you incorporate into your application, the specific features you add, are what set your app apart. The application programming model aims to make your development experience easier, so that you can devote more time and resources to adding value.

The following example shows some of these generic features in action:

Without these generic features, your code would look something like this:

 

2 – It allows you to write less boilerplate code

The application programming model provides effective language bindings for Java and JavaScript. For example, for Java, write optional methods with meaningful annotations (@BeforeCreate, @BeforeUpdate, etc.) to interact with our generic service provider. Typed access to model entities makes your code simple, compact, and easily readable. You no longer need to write and read through many lines of code.

This also has a positive impact on the review process, your app’s performance and the required maintenance. Less code equals:

  • Less time needed for code review
  • Fewer resources used in the packaged application
  • Fewer bugs

Which mean you can spend your time working on code fixes or adding new features. You know which ones I mean. The ones that you would have put off for lack of time… not anymore!

3 – It has reuse principles baked in

Why should you spend time and resources rewriting what already exists? The answer is: you shouldn’t! Our modular approach lets you divide your app into reusable modules that you can flexibly combine depending on what you need. The guiding principle is “reuse instead of re-invent”.

Have a look at the post “ITelO – A Sample Business Application for the new Application Programming Model for SAP Cloud Platform” by Oliver Welzel to learn more about reusing existing data models in your application.

4 – It lets you concentrate on the WHAT, not the HOW

We have all heard the benefits of functional programming models and I think this one is pretty straightforward: You focus on WHAT you want, that is your actual intent, and not HOW it should be implemented. The application programming model for SAP Cloud Platform lets you do just that because it handles the HOW. It’s responsible for finding the most effective way to implement your needs.

If you want to dig a little deeper, check out the post “Monday morning thoughts: what not how” by DJ Adams.

5 – It’s open and flexible

We have designed our programming model based on openness, integration and interoperability. What does it mean for you? We promote your right to choose. It’s true that we provide advanced support for a recommended set of technologies, but that does not mean that you are obligated to use them. You can use your preferred development environment or work with the technology you’re most comfortable with. This also means you can share information and knowledge to create richer models that can be reused and extended depending on the business need.

 

For more information about the application programming model, check out help.sap.com.

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

  1. HP Seitz

    Hi Cecilia,

    nice post.

    Can you give any outlook if and when the new Application Programing Model will also be available on the HANA Platform within HANA XSA (the on-premise version of SAP Cloudfoundry).

    Besides SAP pushing heavily everthing to the cloud, there are still many customers which running on-premise or having everything in their private cloud.

    Thx for your feedback,

    HP

    (1) 
    1. Cecilia Huergo
      Post author

      Hi HP,

      Thanks for comment and great question!

      I can say it is in the pipeline. Once we have more specifics regarding timelines and supported features, we will provide an update.

       

      Thanks,

      Cecilia

      (1) 
  2. Neil Prince

     

    Hi Cecilia

    Great post.

    I am currently creating an application and was looking at how I manage recording change history and also text tables when I stumbled on your blog accidently. You have solved a couple of problems for me straight away.

    Where can I find out more detailed technical information on the new application programming model. There are some basics in the SAP Cloud Platform online help, but I feel there is substantial functionality available to us in this model that I struggle to extract from the documentation. Blogs like yours show usage in a much more effective way. I just don’t want to reinvent the wheel when SAP may have already made life easier for us.

    For example, I am wanting to find out how to do OData deep inserts using this model. How do I look at what is in sap/cds/common to see what is available?

    Thank’s again.

    Neil

     

    (0) 
  3. Neil Prince

    Hi Cecilia

    I have gone through benefit 1 in more detail in conjunction with the sample Itelo application and the developer guide for the business application and am clearer on a lot of points. However, I can’t quite work out how you do the automatic text tables.

    Could you provide an example from your code for the product and text table definitions in the ‘data-model.cds’ file that support the code snippet above from your ‘my-services.cds’ file?

    I am currently getting errors for ‘Unmanaged associations cannot be used in the definition of an ON condition [1310084]’ and Only scalar types allowed in this location of a query [1310083] in the generated hdbcds files for the Product table that I can’t seem to crack.

    Regards

    Neil

    (0) 
    1. Cecilia Huergo
      Post author

      Hi Neil,

      I apologize for the late reply! Unfortunately, we are unable to provide specific help for these issues right now, but new implementations and updates are coming soon. Once these features are properly documented, I will provide an update.

      Thanks,

      Cecilia

      (0) 
      1. Neil Prince

        Hi Cecilia

        Thanks for the reply.So is there a new release of the application programming model coming up? or are there just updates to the documentation coming? Is there a timeframe (even loose) for the updates?

        Regards

        Neil

        (0) 
        1. Cecilia Huergo
          Post author

          Hi Neil,

          Both actually. 🙂 We will be updating the documentation to reflect changes in the application programming model, but unfortunately I cannot comment on the release date yet. We will keep you posted.

          Thanks,

          Cecilia

          (0) 
  4. Neil Prince

    Hi Cecilia

    I see that there has been an update to the CAP in SCP recently. Is this the release you refer to? Is there somewhere we can go to find out more about the features/changes in each release?

    Regards

    Neil

    (0) 

Leave a Reply