You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2013/10/07 10:58:41 UTC

[jira] [Resolved] (ISIS-543) title() should take precedence over @Title, or perhaps should fail eagerly?

     [ https://issues.apache.org/jira/browse/ISIS-543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Haywood resolved ISIS-543.
------------------------------

    Resolution: Fixed

> title() should take precedence over @Title, or perhaps should fail eagerly?
> ---------------------------------------------------------------------------
>
>                 Key: ISIS-543
>                 URL: https://issues.apache.org/jira/browse/ISIS-543
>             Project: Isis
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: core-1.2.0
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: core-1.4.0
>
>         Attachments: ISIS-543.patch
>
>
> 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.  



--
This message was sent by Atlassian JIRA
(v6.1#6144)