Uploaded image for project: 'Causeway'
  1. Causeway
  2. CAUSEWAY-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.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.13.1
    • 1.13.2
    • None
    • 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() { ... }
          }
      }
      

      Attachments

        Activity

          People

            danhaywood Daniel Keir Haywood
            danhaywood Daniel Keir Haywood
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: