SAP-samples / fiori-elements-incident-management

This repository contains the sample OData V4 service material for the tutorials provided in the SAP Developer Center.
Apache License 2.0
30 stars 30 forks source link

Why have annotations in db layer, srv layer and app? #2

Closed js1972 closed 2 years ago

js1972 commented 3 years ago

Hi. This is an excellent example of a CAP app - thank-you.

A question I have though is why we see annotations in all layers of the app: db, srv and app. Given that annotations seem to be for UX purposes - should they not all belong in the /app folder?

Just trying to understand the reasoning - if there's a better place to ask this question let me know?

ARiesterer commented 3 years ago

Hi Jason, I think it depends what kind of annotation we are talking of. When e.g. a field is annotated as a currency field or as a unit of measure field, it would make sense to define the corresponding annotations on a lower, database or field oriented layer. Such kind of fields will most likely be used as currency or unit of measure fields in all apps which are based on the service. Other annotations which might differ from app to app (e.g. visibility/enablement of UI objects) will likely be defined on app level. Best regards Andreas