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

Dan Haywood updated ISIS-1548:
------------------------------
    Description: 
The current mixin conventions gives rise to code such as:

{code}
mixin(Invoice._approve.class, invoice).$$();
{code}

where:

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

We'd like it instead to read:    

{code}
mixin(Invoice.Approve.class, invoice).exec();
{code}

ie:

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

Suggestion is:

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

or (if using `@DomainObject`)

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


  was:
The current mixin conventions gives rise to code such as:

{code}
mixin(Invoice._approve.class, invoice).$$();
{code}

where:

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

We'd like it instead to read:    

{code}
mixin(Invoice.Approve.class, invoice).exec();
{code}

ie:

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

Suggestion is:

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


        Summary: 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.  (was: Allow @Mixin 
annotation to specify the verb to use for the action (instead of '$$'); allow 
'$' to be used as separator.)

> 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.
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: ISIS-1548
>                 URL: https://issues.apache.org/jira/browse/ISIS-1548
>             Project: Isis
>          Issue Type: Improvement
>    Affects Versions: 1.13.1
>            Reporter: Dan Haywood
>            Assignee: Dan Haywood
>            Priority: Minor
>             Fix For: 1.13.2
>
>
> The current mixin conventions gives rise to code such as:
> {code}
> mixin(Invoice._approve.class, invoice).$$();
> {code}
> where:
> {code}
> public class Invoice {
>     ...
>     @Mixin
>     public static class _approve {
>         ...
>         public Invoice $$() { ... }
>     }
> }
> {code}
> We'd like it instead to read:    
> {code}
> mixin(Invoice.Approve.class, invoice).exec();
> {code}
> ie:
> * change "$$" to "exec" (or any other verb)
> * not require the leading "_" in the mixin name
> * allow the class to be capitalized
> Suggestion is:
> {code}
> public class Invoice {
>     ...
>     @Mixin(method="exec")
>     public static class Approve {
>         public void exec() { ... }
>     }
> }
> {code}
> or (if using `@DomainObject`)
> {code}
> public class Invoice {
>     ...
>     @DomainObject(nature=MIXIN, mixinMethod="exec")
>     public static class Approve {
>         public void exec() { ... }
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to