Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
core-1.2.0
-
None
Description
from discussion on mailing list:
Every domain object should provide a title - a string representation of itself that is sufficiently unique to identify it to the end-user. There are two main ways of doing this, either declaratively - using @Title annotations - or imperatively - with the title() method. (If neither are present, then toString() is used).
This ticket is so that the declarative behaviour is the default, but if a class provides a title() method, then this should be used instead. The ticket also suggested that perhaps having both @Title and title() might be considered an error, in which case we could use the MetaModelValidator interface to prevent Isis from booting. However, I think this doesn't make sense, because it might be that the properties annotated with @Title might be inherited from a superclass, whereas the subclass might want to override this with its own title(). So having both shouldn't be considered an error.
I suspect that the fix is very easy ... just reversing the order of the registration of TitleAnnotationFacetFactory and TitleMethodFacetFactory in ProgrammingModelFacetsJava5.