On Mon, Jan 3, 2011 at 3:37 PM, Greg Brown <[email protected]> wrote:

> > It would be confusing to change the semantics of existing selectedIndex.
> It looks like very imperative operator which is not appropriate for using
> element attribute declaration.
>
> ...and yet BXML, which uses attributes extensively, handles it just fine.
>  :-)
>
> > The clearer approach would be to introduce new declarative attribute
> operator like selectedDefaultIndex, which will not apply immediately for the
> existing element list.
>
> When would it be applied? This is what I mean when I say it would be more
> confusing. I know immediately what "selectedIndex" and setSelectedIndex()
> do. I have no idea what "selectedDefaultIndex" means.
>

I'm not familar with the implemetation of selectedIndex, but my guess is
that it is used when some getSelectedElement is called. If that is the case,
if there are no selected element is found, it can use the
selectedDefaultIndex information to get the element from the elements. These
or some lazy evaluation function are often used idiom, it is not umbiguos.



>
> > But as you will see, we need to know which attributes need to be defined
> later, we must have detailed knowledge for the API. these are not so
> easy/simple API for the user.
>
> I think you may be getting hung up on trying to automatically generate code
> that is organized the way you want it. A developer writing out your builder
> syntax by hand will know when it is appropriate to call each setter, and
> (once again) it does not matter where these attributes are set in generated
> code.
>

As I said, (although I mentioned code generator), my main concern is what
kind of hand write coding style can be supported with Pivot library.
If there is not much such exception like selectedIndex, I do not care much
for this issue.
But I think there are useful information for you to understand what kind of
problems pivot users would face when they start writing Java code directly.


>
> G
>
>


-- 
Cheers,
calathus

Reply via email to