> 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). G
