finos / spring-bot

Spring Boot + Java Integration for Symphony/Teams Chat Platform Bots and Apps
https://springbot.finos.org
Apache License 2.0
60 stars 35 forks source link

@Display annotation to override field name #165

Closed robmoffat closed 3 years ago

robmoffat commented 3 years ago

Feature Request

Description of Problem:

Although overriding Freemarker templates are the preferred way of handling display logic, it is sometimes useful to modify the default behaviour of the provided Freemarker templater

Potential Solutions:

  1. Improve default field naming: if the field is called someVal, the field should be displayed as Some Val. This should be the default. This should happen without the @Display.

  2. @Display annation to hide a field: @Display(visible=false) This should work in all the various places: where the field is displayed as a column, or a row in a bean.

  3. @Display annotation to rename a field: @Display(name="Some ABC Field Name (complicated)")

Further Customisation

Adding Styles to the annotation doesn't feel like the right approach, as it breaks the separation between display logic (in the template) and business logic (in the bean). As @sureshrupnar points out, usually these tasks are handled by different team members, so we should try and keep these separate.