You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Adrian Wiesmann <aw...@somap.org> on 2007/09/07 17:22:27 UTC

Introducing Gozer - Extending DataViews

Hello list

I'd like to introduce the project code-named Gozer to you. Gozer is
currently a proof of concept project where we try to take the idea of the
existing DataViews, to mix them with other ideas (XUL), and to find out
what would be possible and what would make sense.

Our main question was how we could extend Cayenne so that we can bind
DataObjects to Swing elements without having to code the whole UI for
every new frame or dialog. We also noticed that building frames with
multiple Swing components (which are in relation with each other) required
us to load several DataViews, separate DataObjectLists, etc.

We somehow always banged our heads against the ceiling (like we say over
here). So we designed Gozer with that goal: Quick and easy, data bound UI
generation with as few lines of code as possible.

We added some information about the current prototype of Gozer to our
Wiki. The example is far away from being complete, but you should be able
to get the general picture:

<http://somap.wiki.sourceforge.net/design_sobfv2_gozer>

Now I would like to get your feedback. If you have a question or some
comment to make, please drop me a note.

Regards,
Adrian

Re: Introducing Gozer - Extending DataViews

Posted by Adrian Wiesmann <aw...@somap.org>.
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

Re: Introducing Gozer - Extending DataViews

Posted by Aristedes Maniatis <ar...@maniatis.org>.
On 08/09/2007, at 1:22 AM, Adrian Wiesmann wrote:

> Now I would like to get your feedback. If you have a question or some
> comment to make, please drop me a note.


Hi Adrian

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

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?

Cheers
Ari Maniatis



-------------------------->
Aristedes Maniatis
phone +61 2 9660 9700
PGP fingerprint 08 57 20 4B 80 69 59 E2  A9 BF 2D 48 C2 20 0C C8