On 15 February 2013 13:07, Maurizio Taverna <[email protected]>wrote:

> I find the Isis framework has the potential to solve most issues in a
> simple and smart way however
> to change, for example, the order in which fields are presented, you need
> to change a small thing in the Java source code.
> Here comes the question: "do we really need to change this?"
>
>
I might be misunderstanding your question, but at any rate...

Isis actually orders the members (properties, collections, actions) by
looking at the value of the MemberOrderFacet attached to each member.  The
default programming model [1] configures
the MemberOrderAnnotationFacetFactory [2] which looks for the @MemberOrder
annotation.  However, you could [3] easily install your implementation that
reads this metadata from somewhere else.

One caveat: it isn't currently possible to dynamically reorder the members;
they are immutable once the ObjectSpecification representing the class has
been built.  But I don't imagine there would be much difficulty in creating
some little API to recalculate the order if need be.

HTH
Dan

[1]
https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/progmodels/dflt/ProgrammingModelFacetsJava5.java
[2]
https://github.com/apache/isis/blob/master/core/metamodel/src/main/java/org/apache/isis/core/progmodel/facets/members/order/MemberOrderAnnotationFacetFactory.java
[3]
http://isis.apache.org/core/metamodel-finetuning-the-programming-model.html

Reply via email to