[
https://issues.apache.org/jira/browse/ISIS-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13787997#comment-13787997
]
ASF subversion and git services commented on ISIS-543:
------------------------------------------------------
Commit 7c96689cda4afa0cd3f206909872bc2d032a4b2e in branch refs/heads/master
from [~danhaywood]
[ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=7c96689 ]
ISIS-543: title() take precedence over @Title
If a class has both a title() and (non-inherited) methods annotated with @Title,
then this is a metamodel violation.
Patch contributed by: Othmen Tiliouine <[email protected]>
Signed-off-by: Dan Haywood <[email protected]>
> 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)