Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1548

Allow @Mixin annotation to specify the method name to use (instead of '$$') meaning to infer the mixin name from the mixin type. Also, allow '$' to be used as separator of the mixin type.

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.13.1
    • Fix Version/s: 1.13.2
    • Component/s: None
    • Labels:
      None

      Description

      The current mixin conventions gives rise to code such as:

      mixin(Invoice._approve.class, invoice).$$();
      

      where:

      public class Invoice {
          ...
          @Mixin
          public static class _approve {
              ...
              public Invoice $$() { ... }
          }
      }
      

      We'd like it instead to read:

      mixin(Invoice.Approve.class, invoice).exec();
      

      ie:

      • change "$$" to "exec" (or any other verb)
      • not require the leading "_" in the mixin name
      • allow the class to be capitalized

      Suggestion is:

      public class Invoice {
          ...
          @Mixin(method="exec")
          public static class Approve {
              public void exec() { ... }
          }
      }
      

      or (if using `@DomainObject`)

      public class Invoice {
          ...
          @DomainObject(nature=MIXIN, mixinMethod="exec")
          public static class Approve {
              public void exec() { ... }
          }
      }
      

        Activity

        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 147f4c5d4a4eb7541b06a628b7d666bc5169c4f5 in isis's branch refs/heads/maint-1.13.2 from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=147f4c5 ]

        ISIS-1548: extends @Mixin and @DomainObject to accept (mixin)method() attribute; updates facets; updates algorithm for inferring mixin name/id based on when the name of the method being processed matches this attribute (rather than hard-coded "$$" as previously).

        Also, supports using "$" (as well as "_") as the separator for MixinType_mixinName (ie for nested static classes).

        Most of the stuff in ObjectMemberAbstract, plus the three Mixin classes, ObjectActionMixedIn, OneToOneAssociationMixedIn, OneToManyAssociationMixedIn.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 147f4c5d4a4eb7541b06a628b7d666bc5169c4f5 in isis's branch refs/heads/maint-1.13.2 from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=147f4c5 ] ISIS-1548 : extends @Mixin and @DomainObject to accept (mixin)method() attribute; updates facets; updates algorithm for inferring mixin name/id based on when the name of the method being processed matches this attribute (rather than hard-coded "$$" as previously). Also, supports using "$" (as well as "_") as the separator for MixinType_mixinName (ie for nested static classes). Most of the stuff in ObjectMemberAbstract, plus the three Mixin classes, ObjectActionMixedIn, OneToOneAssociationMixedIn, OneToManyAssociationMixedIn.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit f057d29d883ea6ca9dd49e9bb8070b8676d81b0f in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=f057d29 ]

        ISIS-1503 and ISIS-1548: further documentation updates for these tickets (@Mixin, @DomainObject, UserService, AuthenticationSessionProvider, SudoService)

        Show
        jira-bot ASF subversion and git services added a comment - Commit f057d29d883ea6ca9dd49e9bb8070b8676d81b0f in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=f057d29 ] ISIS-1503 and ISIS-1548 : further documentation updates for these tickets (@Mixin, @DomainObject, UserService, AuthenticationSessionProvider, SudoService)
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 147f4c5d4a4eb7541b06a628b7d666bc5169c4f5 in isis's branch refs/heads/master from Dan Haywood
        [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=147f4c5 ]

        ISIS-1548: extends @Mixin and @DomainObject to accept (mixin)method() attribute; updates facets; updates algorithm for inferring mixin name/id based on when the name of the method being processed matches this attribute (rather than hard-coded "$$" as previously).

        Also, supports using "$" (as well as "_") as the separator for MixinType_mixinName (ie for nested static classes).

        Most of the stuff in ObjectMemberAbstract, plus the three Mixin classes, ObjectActionMixedIn, OneToOneAssociationMixedIn, OneToManyAssociationMixedIn.

        Show
        jira-bot ASF subversion and git services added a comment - Commit 147f4c5d4a4eb7541b06a628b7d666bc5169c4f5 in isis's branch refs/heads/master from Dan Haywood [ https://git-wip-us.apache.org/repos/asf?p=isis.git;h=147f4c5 ] ISIS-1548 : extends @Mixin and @DomainObject to accept (mixin)method() attribute; updates facets; updates algorithm for inferring mixin name/id based on when the name of the method being processed matches this attribute (rather than hard-coded "$$" as previously). Also, supports using "$" (as well as "_") as the separator for MixinType_mixinName (ie for nested static classes). Most of the stuff in ObjectMemberAbstract, plus the three Mixin classes, ObjectActionMixedIn, OneToOneAssociationMixedIn, OneToManyAssociationMixedIn.

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            danhaywood Dan Haywood
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development