Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS Annotation structuring

SidAnand
Explorer
1,047

Hi Experts,

Does arranging the same CDS Annotation in a hierarchy have an affect on the CDS in any way performance wise or otherwise?

e.g.

Way 1

        @UI: {facet:[ { purpose: #STANDARD,
                       type: #IDENTIFICATION_REFERENCE,
                       label:'UI facet label',
                       position: 10} ],
              lineItem:[ { position: 10,
                           label: 'UI Lineitem Label' } ],
              selectionField: [ { position: 10 } ] } 

way 2

        @UI.facet.purpose: #STANDARD
        @UI.facet.type: #IDENTIFICATION_REFERENCE
        @UI.facet.label:'UI facet label'
        @UI.facet.position: 10
        @UI.lineItem.position: 10
        @UI.lineItem.label: 'UI Lineitem Label'
        @UI.selectionField.position: 10

Is it more of a aesthetic and code beauty point of view?

or does it have some performance related aspect.

I am new to this CDS.

1 ACCEPTED SOLUTION
Read only

maheshpalavalli
Active Contributor
737

Hi Siddharth,

There will be no performance issue on cds view, because these annotations are used only when u activate ur cds view and these will be saved to a DB table and while u generate the odata service, they will be used to create annotation service.

So surely writing them in different ways will not affect the performance.

But the first way is better as it is more readable especially in case if you have array of facet annotations.

-Mahesh

1 REPLY 1
Read only

maheshpalavalli
Active Contributor
738

Hi Siddharth,

There will be no performance issue on cds view, because these annotations are used only when u activate ur cds view and these will be saved to a DB table and while u generate the odata service, they will be used to create annotation service.

So surely writing them in different ways will not affect the performance.

But the first way is better as it is more readable especially in case if you have array of facet annotations.

-Mahesh