Prefab

Ken Webb 2010-04-23T12:50:57Z

Prefab is "a system for implementing advanced behaviors through the reverse engineering of the pixels of graphical interfaces". From reading the available research papers on Prefab, it's hard to tell if there is a direct Xholon tie-in. But, the general idea of reverse engineering of GUIs from pixels does suggest some possible Xholon applications.

Use Cases

Here are some possible use cases:

One Possible Scenario

Here's a possible scenario for the first use case above:

For example, the following is part of an online form from an airline (Air Canada).

This might be captured as the following XML content.

<?xml version="1.0" encoding="UTF-8"?>
<JFrame>
  <Attribute_String roleName="Title">Retrieve Your Booking</Attribute_String>
  <JPanel>
    <Attribute_String roleName="Background">WHITE</Attribute_String>
    <EmptyBorder>
      <Attribute_String roleName="Rectangle">Rect,10,5,10,5</Attribute_String>
    </EmptyBorder>
    <FormLayout>
      <Attribute_String roleName="ColumnSpec">Right:pref,3dlu,pref:grow,7dlu,pref</Attribute_String>
      <Attribute_String roleName="RowSpec">pref,10dlu,pref,10dlu,pref</Attribute_String>
    </FormLayout>
    <JLabel>
      <Attribute_String roleName="Text">Booking reference:*</Attribute_String>
      <Attribute_String roleName="CellConstraints">cc,1,1</Attribute_String>
    </JLabel>
    <JTextField>
      <Attribute_int roleName="Columns">10</Attribute_int>
      <Attribute_String roleName="CellConstraints">cc,3,1</Attribute_String>
    </JTextField>
    <JLabel>
      <Attribute_String roleName="Text">Passenger last name:*</Attribute_String>
      <Attribute_String roleName="CellConstraints">cc,1,3</Attribute_String>
    </JLabel>
    <JTextField>
      <Attribute_int roleName="Columns">10</Attribute_int>
      <Attribute_String roleName="CellConstraints">cc,3,3</Attribute_String>
    </JTextField>
    <JButton>
      <Attribute_String roleName="Text">RETRIEVE BOOKING</Attribute_String>
      <Attribute_String roleName="ActionCommand">retrievebooking</Attribute_String>
      <Attribute_String roleName="Background">RED</Attribute_String>
      <Attribute_String roleName="Foreground">WHITE</Attribute_String>
      <Attribute_String roleName="CellConstraints">cc,3,5</Attribute_String>
    </JButton>
  </JPanel>
</JFrame>

This XML content can then be pasted into a running Xholon application, and will appear as follows.

The following is what the overall GUI might look like once this new window is pasted into a running Xholon app. As it is, only the existing game GUI is connected to a Controller object, but it would be very easy to connect the new airline GUI to a Controller that would know how to process a retrievebooking message. The Java code for such a Controller can also be pasted into the app at runtime.

You can even take the new XML and paste it into the existing game GUI, to get the following combination.

Future Potential

Currently, as far as I know, the Prefab software is not publicly available. It currently only supports common widgets and does not support text. So at this point, the GUI capture steps in the scenario for the first use case, are not doable. But Prefab does point in an interesting direction.

return to main page