cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using base, interface and consumption view for a entity

felixw
Explorer
2,019

Dear community,

I was wondering about the sense of base views in an RAP context: Most of the documentation and tutorials I read claim that in RAP a single entity should be composed out of three CDS view layers: (1) base view, (2) interface view and (3) consumption view. This is also reflected in the showcase app.

However, from my experiences so far with RAP I find all three layers rather cumbersome. If one layer is skipped I think the base layer is the obvious choice. Entities consisting out of interface view and consumption view only can be seen for example in the DMO flight scenario.

I was wondering what are the experiences of others. Do you use all three layers or only two? What are your experiences there?

Kind regards

Accepted Solutions (0)

Answers (2)

Answers (2)

DiegoValdivia
Active Participant

SAP will not like my answer, but in my case, I don't use the three layers, but only use one.

When I started developing my firsts production apps, I tried to follow the three layer technique, but I found it to be very time consuming. I mean, every time a user wanted to add a new field or wanted to remove a new field, I had to add it to the three layers, including the Behavior Definition and Behavior Projection as well as the Behavior Pool Class.

The biggest problem came when deleting fields, because I got a lot of dependency errors that took a lot of time to fix.

After two years working on ABAP Restful apps, I think that the three layer technique is good if you plan to re-use the base objects, but if you plan to use the main CDS view only in one app, I don't think it's necessary.

But again, this is just my experience, I wouldn't say it's an advice.

felixw
Explorer
0 Kudos

Thanks for sharing your experiences @DiegoValdivia. After a year with RAP I have basically the same experiences with using three layers. And I couldn’t agree more that especially removing fields or changing field names is rather painful (e.g. fixing a typo which is in all three layers can take up to an hour).

To me, regarding to your mentioned re-usage aspect it is also questionable how often intense re-usages of custom developed views actually happens. Of course, for central SAP standard  views the re-usage should happen quite frequently.

I just re-factored an application to use two layers instead of three which so far seems like a good decision.