Mark Space wrote:
JK wrote:
The problem with most GUI builders is that the input to the code
generation process is human activity -- drag-and-drop, point-and-click
-- that *can't* be placed under version control, or even stored in
any meaningful way at all. So that's my principled objection to
GUI generator tools. YMMV.
That's a bit like saying that the output of a text editor isn't
suitable for revision control, because it's the result of human
activity, typing keys on a keyboard.
No, I'm saying the *input* of a text editor -- the motions I make
as I push the keys with my fingers -- isn't suitable for revision
control. However, the output of a text editor has the nice property
that it completely captures the intent of the input, so in this case
there's no effective difference between input and output.
Just FYI, here's part of a .form file I just started in a small
personal project. (Just part because the whole thing is rather long.)
<?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.6"
type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
<NonVisualComponents>
<Menu class="javax.swing.JMenuBar" name="jMenuBar1">
<SubComponents>
<Menu class="javax.swing.JMenu" name="jMenu1">
<Properties>
<Property name="text" type="java.lang.String" value="File"/>
</Properties>
I think that's pretty easy to place under revision control.
Yes. This is both an output and an input to the tool, I
expect. If this file lets the whole layout be re-loaded into
the GUI tool and edited -- *and* if the code it generates
doesn't require manual mods by humans -- then cool; this is
exactly the thing that ought to be version-controlled.
Other UI-builder tools I've used have not provided such an
easily-manageable representation of a layout; they just
spewed out several dozen pages of code, which humans often
had to (or were tempted for the sake of expediency to) maintain,
and which was sometimes not re-digestible by the tool. So
in that case the output didn't fully capture the intent of
the human neuro-muscular input -- the result had to be
processed further, which led to ongoing pain during the
maintenance cycle.
Anyway, I will say you've prompted me to think about
these issues more clearly. I really will take a look at
NetBeans :-)
I prefer to use generated code as an input to human modification. When the
generated code not in the repository.
modified from the generator's output. One replaces outdated versions with
keep all the generator tools at hand.
understand the reluctance to follow that policy. What really aggravates me at
work is that they use both policies. Some projects in the product
version-control generated code, some don't. They should keep all of it in VC.