Most Powerful Open Source ERP

Guideline Semantic Field Should Be Used In Favor Of Technical Field

Semantic fields are more specific and descriptive.
  • Last Update:2017-04-10
  • Version:001
  • Language:en

Semantic Field Should Be Used In Favor Of Technical Field

It is always better to proxy a field from a semantic field library (if you work in Trade, first proxy from TradeFieldLibrary before proxying a base field.

Good Example:

SaleOrder_view[my_title]

-> Base_viewTradeFieldLibrary[my_view_mode_title]
  -> Base_viewFieldLibrary[my_view_mode_title]
    -> Base_viewFieldLibrary[my_string_field]

Bad Example:

SaleOrder_view[my_title]

-> Base_viewTradeFieldLibrary[my_view_mode_title]
    -> Base_viewFieldLibrary[my_string_field]

The only exception is if a technical field is generally used for the same purpose and if it is good enough to share for all use cases. Only then we don't need the semantic field in Base_viewFieldLibrary and it is acceptable to link to the technical field directly outside from the default field library.

For example, the following is OK (not "good"), because relation string field is always used for category:

Good Example:

SaleOrder_view[my_source_title]

-> Base_viewTradeFieldLibrary[my_view_mode_source_title]
  -> Base_viewFieldLibrary[my_relation_field]

Bad Example:

SaleOrder_view[my_incoterm]

-> Base_viewTradeFieldLibrary[my_view_mode_incoterm]
    -> Base_viewFieldLibrary[my_list_field]

This is bad, because list_field can be used for different purpose. It would be better to do:

SaleOrder_view[my_incoterm]

-> Base_viewTradeFieldLibrary[my_view_mode_incoterm]
  -> Base_viewFieldLibrary[my_view_mode_category]
    -> Base_viewFieldLibrary[my_list_field]