Dan Haywood created ISIS-1056:
---------------------------------

             Summary: Support user-defined annotations (as per Spring and 
JSR-303 etc).
                 Key: ISIS-1056
                 URL: https://issues.apache.org/jira/browse/ISIS-1056
             Project: Isis
          Issue Type: New Feature
          Components: Core
    Affects Versions: core-1.8.0
            Reporter: Dan Haywood
            Assignee: Dan Haywood
             Fix For: core-2.0.0


eg, instead of:

@Action(semantics=SemanticsOf.SAFE)
@ActionLayout(contributed=Contributed.AS_ASSOCIATION)
@CollectionLayout(render=RenderType.EAGERLY)
public List<Foo> someFoos() { ... }

we could allow custom annotations like this to be defined:

@Action(semantics=SemanticsOf.SAFE)
@ActionLayout(contributed=Contributed.AS_ASSOCIATION)
@CollectionLayout(render=RenderType.EAGERLY)
public @interface ContributedCollection {
}

which would then allow:

@ContributedCollection
public List<Foo> someFoos() { ... }

~~~~
This might also be a good way to support value types, eg by introducing a new 
ValueObject and ValueObjectLayout annotations:

@ValueObject (
    mustSatisfy=MoneySpec.class,
    appliesTo={BigDecimal.class}
)
@ValueObjectLayout(
    named="Money"
)
public @interface Money {
}

and then:

public void deposit(@Money BigDecimal bd) { ... }

Behind the scenes, Isis would just be copying facets from the 
ObjectSpecification that represents the @Money annotation onto the parameter or 
property feature..



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

Reply via email to