You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Andi Huber (JIRA)" <ji...@apache.org> on 2018/01/14 19:28:00 UTC

[jira] [Commented] (ISIS-1816) Specify framework's behavior if multiple @Parent annotations or parent() methods are resolved in the object's hierarchy

    [ https://issues.apache.org/jira/browse/ISIS-1816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16325730#comment-16325730 ] 

Andi Huber commented on ISIS-1816:
----------------------------------

In general I find it difficult to memorize a specification, that needs lots of rules, so why not take the radical approach and simplify. Here's my proposal:

1) remove the resolve parent by method "parent()" functionality, since ...
a) ... it's difficult to memorize what takes precedence annotation or method
b) ... we don't want to introduce new 'keywords' since this unnecessarily complicates things (possible conflict with actual business method names, that are intended for other use)

2) Do not allow (or ignore) @Parent annotations on Java Interfaces, since multiple inheritance would allow scenarios, where a metadata evaluation of domain-objects becomes arbitrarily complex.

3) Any class (abstract or concrete) may at most have one @Parent annotation (on either a method or a field); otherwise metadata evaluation fails with an error.

4) The annotated member (method or field), when ...
a) ... a method: must be a no-arg method returning a non-primitive type
b) ... a field: then the field must be of non-primitive type and must also have a getter (as specified by the Java Beans Standard, particularly to allow lombok getters by @Getter annotation of fields)

5) Starting from the current domain-object class we search down the object inheritance hierarchy until we find the first super class that has a @Parent annotation. That's the one we use to resolve the current domain-object 's navigable parent.

> Specify framework's behavior if multiple @Parent annotations or parent() methods are resolved in the object's hierarchy
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-1816
>                 URL: https://issues.apache.org/jira/browse/ISIS-1816
>             Project: Isis
>          Issue Type: Sub-task
>          Components: Core
>    Affects Versions: 2.0.0-M1
>            Reporter: Andi Huber
>             Fix For: 2.0.0-M1
>
>
> We need a clear specification on how the framework behaves if multiple @Parent annotations or parent() methods are resolved in the object's hierarchy.
> And reflect this with code in metamodel's
> {code:java}
> org.apache.isis.core.metamodel.facets.object.navparent.annotation.NavigableParentAnnotationFacetFactory
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)