Skip to content

Commit 1c283b8

Browse files
authored
Align with entity naming best practice (#2201)
See: https://cap.cloud.sap/docs/guides/domain-modeling#naming-conventions There are plenty of entity names in examples in this CDL topic. Some of them are "real" in that they are genuine representations such as Orders and Products. These should be subject to the naming convention best practice of being pluralised. Others are clearly illustrative only, such as the Foo, Bar, Baz set and those conveying meaning for the given example such as EmployeeView, SomeView, P, Proj, SomeExposedEntity and so on. These should not be subject to the naming convention. Note: Perhaps we should add something to the naming convention section itself to qualify the boundary of where it applies, i.e. "mostly" at the schema level, less so at the service definition level?
1 parent 888c7b2 commit 1c283b8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cds/cdl.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ type Complex {
639639
If the element has an enum type, you can use the enum symbol instead of a literal value:
640640
```cds
641641
type Status : String enum {open; closed;}
642-
entity Order {
642+
entity Orders {
643643
status : Status default #open;
644644
}
645645
```
@@ -650,7 +650,7 @@ entity Order {
650650
If you want to base an element's type on another element of the same structure, you can use the `type of` operator.
651651

652652
```cds
653-
entity Author {
653+
entity Authors {
654654
firstname : String(100);
655655
lastname : type of firstname; // has type "String(100)"
656656
}
@@ -685,7 +685,7 @@ For string types, declaration of actual values is optional; if omitted, the actu
685685

686686
```cds
687687
type Gender : String enum { male; female; non_binary = 'non-binary'; }
688-
entity Order {
688+
entity Orders {
689689
status : Integer enum {
690690
submitted = 1;
691691
fulfilled = 2;
@@ -1916,14 +1916,14 @@ exposing entities.
19161916

19171917
```cds
19181918
service CatalogService {
1919-
entity Product as projection on data.Products {
1919+
entity Products as projection on data.Products {
19201920
*, created.at as since
19211921
} excluding { created };
19221922
}
19231923
service MyOrders {
19241924
//> $user only implemented for SAP HANA
1925-
entity Order as select from data.Orders { * } where buyer=$user.id;
1926-
entity Product as projection on CatalogService.Product;
1925+
entity Orders as select from data.Orders { * } where buyer=$user.id;
1926+
entity Products as projection on CatalogService.Products;
19271927
}
19281928
```
19291929

@@ -2096,7 +2096,7 @@ Within service definitions, you can additionally specify `actions` and `function
20962096

20972097
```cds
20982098
service MyOrders {
2099-
entity Order { /*...*/ };
2099+
entity Orders { /*...*/ };
21002100
// unbound actions / functions
21012101
type cancelOrderRet {
21022102
acknowledge: String enum { succeeded; failed; };

0 commit comments

Comments
 (0)