Re: Introducing Gozer - Extending DataViews

From: Adrian Wiesmann (awiesman..omap.org)
Date: Sat Sep 08 2007 - 08:45:52 EDT

  • Next message: Gilberto C Andrade: "Re: Postgresql 8.2 and cayenne 2.0.3 - idle connections"

    Hello Ari

    > Interesting idea, but I'm not clear about exactly what problem it is
    > solving. Is it:
    >
    > * increase development speed of creating forms
    > * allow end user (with XML knowledge) to define their own form layout
    > * as a type of DirectToSwing (WebObjects style concept) quick way to
    > mock up applications

    All of them, although the first and second are main goals, the third is
    something like a side effect :)

    I want to be able to make new forms without the need to compile anything
    and existing forms should be changeable. Since forms can be rendered into
    PDF/Text format, users would be able to create/personalise reports on
    their own.

    > The main issue I foresee is having the flexibility to lay out edit
    > forms exactly as required. Taken to the extreme, you could end up
    > creating something like Matisse where the entire form design is
    > stored in XML (although you go further with the data binding of
    > course). Your example has a very simple box layout style design - do
    > you intend to take that much further?

    Well, that is a point which we discussed quite much: UI flexibility. At
    the moment I plan to have just one pre-defined layout which resembles some
    simple HTML-alike table layout. You can put boxes into other boxes and at
    the end you have some kind of table structure (we therefore make use of
    TableLayout). That should suffice, at least for the project for which we
    will need Gozer.

    But then you could subclass the standard Swing renderer and have something
    like CSS, or elements with an absolute position. You could also go on and
    create your forms with your own method and just use the DataBinding from
    Gozer.

    For the DataBinding to work we also introduce 3 new classes: DataRow,
    DataTable and DataContainer.
    - DataRow is the base class for what Cayenne knows as DataObject.
    - DataTable is the representation of the table and knows all about the
    business/domain logic of its table (fillbykey, fillbyquery, persist, etc).
    - DataContainer keeps all DataTables together.
    A frame does then typically work on one DataContainer.

    So for the demo on the wiki I created DataTables for both tables and call
    the FillByQuery method on them (loading DataObjects via ObjectContext).
    Since the DataTables are linked with a DataContainer, I then hand the
    DataContainer to the renderer. The renderer does then analyse the binding
    information and binds the Swing element with a DataObject via a DataTable.
    The idea behind this is that the developer will code some business logic
    which loads the required data via DataTables. The binding does then
    operate on the loaded data (everything in the DataContainer) only.

    Hmm I should probably do some illustration or two :)

    Regards,
    Adrian



    This archive was generated by hypermail 2.0.0 : Sat Sep 08 2007 - 08:46:32 EDT