...
Type | Naming Convention | Example |
---|---|---|
JavaScript Object | oObjectName | oCompany |
Integer | iIntegerValue | iCount |
Float | fFloatValue | fTotalValue |
Array | aArrayName | aCustomers |
Boolean | bBooleanValue | bVisible |
String | sString | sText |
OData Sets
FAB generates the
GET_ENTITY_SET
method in the Data Provider Class for you automatically, with a built-inCASE
statement to deal with the Entity Sets that the code needs to handle. While it is tempting to keep all logic (for every Entity Set) in this method, it is not considered good (OO) practice - it is hard to maintain, difficult to find code and the method does not conform to the principle of "do one thing, and one thing well".
Instead, we recommend that you code the logic for every Entity Set in its own (appropriately named) method, and simply call these methods under the relevantWHEN
of theCASE
statement. TheĀGET_ENTITY_SET
method should therefore simply act as a switching mechanism to direct the processing to the relevant method.We recommend naming your Entity with the singular version of the noun (like
Customer
orCompany
) and the Entity Set as the plural (Customers
orCompanies
). An acceptable alternative would be using the patternEntitySet
, for example,CustomerSet
orCompanySet
instead.Please remember to implement manual pagination of the Entity Set for performance reasons when the method could return a large volume of data.
...