diff --git a/resources/guidelines.md b/resources/guidelines.md index 9ea2174..b5e1a50 100644 --- a/resources/guidelines.md +++ b/resources/guidelines.md @@ -44,7 +44,10 @@ ``` - Find more information on the UI5 documentation page "Declarative API for Initial Components" - **ALWAYS** use data binding in views to connect UI controls to data or i18n models. - - When binding data from OData services, **NEVER** use custom formatters for standard data types (e.g., dates, numbers, currencies). The built-in types handle these cases automatically. +- **ALWAYS** prefer built-in data types with format options for formatting in data binding: + - To handle standard formatting needs, use **built-in data types with format options**, for example `sap.ui.model.type.Integer` or `sap.ui.model.type.Currency` with a `formatOptions` object. For OData models, use the types provided in the `sap.ui.model.odata.type` namespace, for example `sap.ui.model.odata.type.Decimal`. + Example: For number formatting with a thousands separator, use `sap.ui.model.type.Integer` with `formatOptions: {groupingEnabled: true}`. + - Only write **custom formatter functions** for unique business logic that cannot be handled by the built-in data types and their format options. This applies to **ALL** data sources, including OData models, JSON models, and others. Our built-in data types can handle standard data types, such as dates, numbers, and currencies. You should always prefer them over custom solutions. - When making changes to `*.properties` files, **ALWAYS** apply the changes to all relevant locales. This ensures consistency across different language versions of the application. - **Example:** If you add a new key to `i18n.properties`, also add it to existing translation files like e.g `i18n_en.properties`, `i18n_de.properties`, etc. - **NEVER** use inline script in HTML