pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From calathus <calat...@gmail.com>
Subject Re: [pivot] are there any tools to convert bxml to Java?
Date Mon, 03 Jan 2011 22:48:57 GMT
On Mon, Jan 3, 2011 at 2:07 PM, Greg Brown <gk_brown@verizon.net> wrote:

> > If the bxml definition(or GUI) is so simple, this attributes order would
> not be a big issue.
> > but if we have more complex definition like stock_tracker_window.bxml
> file, the corresponding Java code will be following big size.
> > You would imagine how frustration to find corresponding element from
> attribute definitions  if they are moved to after inner class definitions.
>
> If you prefer to see most of your attribute setters before the creation of
> the sub-elements, there's no reason you can't do that. However, there's
> simply no way to avoid calling some setters after sub-element creation. I
> don't see this as a big deal at all, and I actually think it helps improve
> readability - it makes it obvious that those setters depend on the prior
> code having been executed.
>
> And again, this only applies to hand-coded builder code. For the reasons I
> mentioned before, it isn't relevant to generated code. I understand that it
> would be ideal to be able to put all of your setters in one place, but
> logically it just doesn't work (unless you do some sort of deferred set,
> which I actually think has the potential to make the code more confusing).
>

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.
The clearer approach would be to introduce new declarative attribute
operator like selectedDefaultIndex, which will not apply immediately for the
existing element list.

As a workaround, I would change the code so that selectedIndex java code
will be commented out, but declared at opening tag.
then only selectedIndex type java code will be generated at the closing tag
without comment.
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.




>
> G
>
>


-- 
Cheers,
calathus

Mime
View raw message