cancel
Showing results for 
Search instead for 
Did you mean: 

CDL declare service as aspect/interface/aspect

06-09-2022 2:09 PM
kosmopilot Explorer
535 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

I have a service A that depends on another service B. I would like to inverse the dependency, such that in the .cds definition of service A the required service IB is declared as an interface/aspect/abstract service. Therefore, service B would implement the interface IB defined by service A. I don't think there's currently a way to achieve this, is there?

Example:

// A.cds
service A {
  ...


  // declaration of a service as an aspect/interface/abstract etc. that A depends upon
  aspect service IB {
    function bar() returns String;
  }
}
// B.cds
using {A.IB} from "./A"

service B : IB {
  // implements function
  function bar() returns String;
}
0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

hjb
Product and Topic Expert
Product and Topic Expert
0 Likes

That's not possible and won't be possible in the future. Include's don't work on context or service level, only on (structured) type level. Structured types can't contain main artifact definitions but only elements.