Saturday, September 28, 2013

Entity annotations for GUI/Persistence

It is useful to use annotations to excludes hints information from the main source code and to avoid cluttering files which are used in program but not integrated in language source code file system.
Such files will become maintenance problem later.

There are mainly two usage cases for entity class.
  • GUI annotation. for instance, we may want to use customized label name other than default field name, we can attach such information as annotation for the getter definition.
  • Persistence mapping. This is essentially the same as JPA. we may want to more info how OR or DB scheme is associated with the entity.


No comments:

Post a Comment