Skip to Content
Product Information
Author's profile photo Xiao-fei Song

Pruning the CSDL model using the SAP Mobile Services OData CSDL Modeler

If you’re building a mobile application based on SAP Mobile Services against an OData services that contains a very large CSDL model with many entity types, it might be quite time-consuming to generate the proxy classes using the proxy compiler and it also ends up generating many proxy classes your mobile application doesn’t really need. With the latest SAP Mobile Services OData CSDL Modeler, you will be able to prune the CSDL model and generate a new CSDL model that only contains a subset of the entity types or entity sets, and it becomes easy for you to build your mobile application based on the pruned model by running the proxy compiler in Android Studio or iOS assistant.

Pruning the CSDL model using the CSDL modeler

In order to use the pruning functionality, you need to download the latest CSDL modeler from SAP Mobile Services OData CSDL modeler. Then you can open your CSDL model using the modeler:

And then click the prune toolbar button:

and you will see a dialog pops up:

In this dialog, select the entity types that you want to include in the pruned model:

Click “OK” button to close the dialog and the modeler will generate the CSDL model that contains the selected entity types and entity types that are directly related to the selected ones:

From the above screenshot, you can see a pruned model in the diagram that contains only 10 entity types.

If you want to use the pruned CSDL model as a file so that you can run proxy compiler to generate¬† proxy classes, you can click the “Export” button in the toolbar and select “Export pruned model” menu item:

Save the pruned model to your workspace and you should be able to use it for your mobile application development, for example, proxy classes generation as described in https://blogs.sap.com/2018/06/06/feature-spotlight-sap-cloud-platform-sdk-for-android-wizard/ or https://blogs.sap.com/2018/02/14/getting-started-with-the-sap-cloud-platform-sdk-for-ios-part-1/ in your correspoding IDEs:

Summary

In this blog, we demonstrated how to prune a large CSDL model using the latest CSDL modeler so that it’s easier for mobile developers to generate proxy classes using proxy compiler for iOS or Android for the mobile application development. If you are trying to visualize a very big OData CSDL model using the modeler, the modeler will ask you to prune to model first so that you have better user experiences as well.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.