pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: using annotations for binding between XML/Java elements
Date Thu, 14 May 2009 11:56:45 GMT
Thanks for this tip. Sounds like we'll need to make two passes through the fields - one to
process the loads, and another for the binds.
G
 
On Thursday, May 14, 2009, at 07:48AM, "Christopher Brind" <brindy@brindy.org.uk> wrote:
>Hi,
>
>Just a short note about what you say about processing annotations linearly.
>If  this is driven by the result of a call to getDeclaredFields method then
>that doesn't hold true because this method specify the order that the fields
>will be returned:
>
>The elements in the array returned are not sorted and are not in any
>> particular order.
>>
>
>see
>http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#getDeclaredFields()
>
>Same for Java 1.6 as well, afaik.
>
>So (unless I've misunderstood what's happening) I think it would be better
>to be explicit about the bindings.
>
>Cheers,
>Chris
>
>
>2009/5/14 Todd Volkert <tvolkert@gmail.com>
>
>> > Eh...after having converted all of our tutorials and demos to use the new
>> approach, I haven't found it all that difficult to work with.
>>
>> Not all that difficult, no, but consider:
>>
>>    @Load(name="demo.wtkx") private Component content;
>>    @Bind private Rollup buttonsRollup;
>>    @Bind private Rollup listsRollup;
>>    @Bind private Rollup textRollup;
>>    @Bind private Rollup calendarsRollup;
>>    @Bind private Rollup navigationRollup;
>>    @Bind private Rollup splittersRollup;
>>    @Bind private Rollup menusRollup;
>>    @Bind private Rollup metersRollup;
>>    @Bind private Rollup spinnersRollup;
>>    @Bind private Rollup tablesRollup;
>>    @Bind private Rollup treesRollup;
>>    @Bind private Rollup dragDropRollup;
>>    @Bind private Rollup alertsRollup;
>>
>> instead of:
>>
>>    @Load(name="demo.wtkx", compile=true) private Component content;
>>    @Bind(property="content") private Rollup buttonsRollup;
>>    @Bind(property="content") private Rollup listsRollup;
>>    @Bind(property="content") private Rollup textRollup;
>>    @Bind(property="content") private Rollup calendarsRollup;
>>    @Bind(property="content") private Rollup navigationRollup;
>>    @Bind(property="content") private Rollup splittersRollup;
>>    @Bind(property="content") private Rollup menusRollup;
>>    @Bind(property="content") private Rollup metersRollup;
>>    @Bind(property="content") private Rollup spinnersRollup;
>>    @Bind(property="content") private Rollup tablesRollup;
>>    @Bind(property="content") private Rollup treesRollup;
>>    @Bind(property="content") private Rollup dragDropRollup;
>>    @Bind(property="content") private Rollup alertsRollup;
>>
>> Looks compelling to me, and since we have precedent for saying that
>> the annotations will be processed linearly, it's easy to do too.
>>
>

Mime
View raw message