Frequently we want to allow implementations to add attributes to different domain objects that are custom to that specific implementation. (This is equivalent to adding a column to a table in custom software.)
For example Person has PersonAttribute (and PersonAttributeType), Visit has VisitAttribute (and VisitAttributeType), etc.
The pattern we used when implementing PersonAttribute and PersonAttributeType (i.e. have a "format" column which specifies the java class of the attribute value) isn't quite right, so we want to provide a better mechanism. Initially this will be used in Visit Attributes, but eventually it will be extended to other attributes as well.
We will add "AttributeTypeHandler", an interface whose implementations:
- control the way that values are converted to and from Strings (for database storage)
- control what widget is displayed in the UI for this attribute type
Finding a way to implement this without mixing up our API and UI layers is going to be tricky...