Andrus,
I am interested in your idea. The downside is that, while I am
motivated, I am not familiar with your code and would have to rely on
you for coaching in order to conform to your team's design goals.
I have been looking at some use cases (implemented with totally
different utilities): Navicat & OpenOffice. Both can connect with a
database, execute bi-directional data transfer, and present the data
in a spreadsheet format. The (*big*) downside is that you lose the
security features of the 3-tier design (i.e. you can totally destroy
your database integrity if your user make mistakes.) Still, the
UPDATE solutions are interesting: Navicat allows multiple edits and
with multiple rows without updating, then with a single user command,
it updates all the changes at once. OpenOffice, however, makes each
change as soon as you move your cursor to a new cell. Both work well,
the Navicat design seems more efficient.
As far as representing relationships goes: the ORM "fault" pattern is
a brilliant solution for Enterprise Objects. I just don't know how
that could be easily represented with a "grid" display. I think some
solutions I have seen have attempted to presented multiple grids with
each representing a relationship. (Idea: maybe abstracting the
standardized cell updating philosophy, like presenting a calendar for
a date, perhaps when a relationship is made editable it is depicted by
displaying a second grid.)
My brain hurts! :) You guys must have these discussions all the time.
I would love to just get one entity represented by one grid working
for right now. If you want me to help out with code, then please let
me know if you think this is a worthwhile goal, the scope, the the
amount of time.
Thanks,
Joe
On Jan 20, 2008, at 4:18 PM, Andrus Adamchik wrote:
I wanted to implement this kind of technology for some time.
Unfortunately given all other things we are working on, I didn't get
too far in actually doing it.
My first idea was to provide a JS client for Cayenne ROP, but then
we'd have to code ObjectContext implementation for the client
side... Seemed like an overkill at the time... Now that I checked
ExtJS, it looks like its Store concept can serve as an analog of a
caching client context, with a benefit being that it is already tied
to a bunch of nice UI widgets...
DWR looks very promising as a back-and-force data transport, tied to
the ExtJS Store on the client... So the last missing piece is a DWR
Cayenne service... We can follow ROP (HessianService) in defining
such service... although since the same DataContext will be used for
JSP page generation as well DWR request processing, we don't have to
write any Cayenne bootstrapping code, and simply use
DataContext.getThreadDataContext()... Instead of supporting all
types of queries like ROP does, the JS service can (and should - for
security reasons) support only mapped named queries.
I think it should be fairly easy to build such framework for the
simplest case of fetching and updating a single entity... Handling
relationships can be trickier.
Anyways, that's some food for thought. If you are motivated to build
such framework, maybe we can collaborate on it on cayenne dev list?
I won't promise to dedicate much time to it, but I am very
interested in this technology as I said above, and would like to see
it either as a part of Cayenne or readily available to Cayenne users
via other venues.
Andrus
On Jan 20, 2008, at 8:14 PM, Joe Baldwin wrote:
Has anyone gotten ExtJS-grid playing well with Cayenne via JSP? I
got the demo (below) working on my Tomcat server using a static XML
file as the datasource, but that is far removed from bi-directional
communication with Cayenne. Check out the field-editing
capabilities of this interface:
http://extjs.com/deploy/dev/examples/grid/edit-grid.html
The problem is that ExtJS tutorials fall somewhat short of proving
that ExtJS-grid can interoperate with an ORM (even though they
claim that it works with JSP). There is one comment about using
DRW to accomplish this easier.
http://getahead.org/dwr
But again, I have seen no working example that proves the concept.
If the answer is no, then I will continue hammering on it and then
post the results. My theory is that an "Editable Grid" (aka
spreadsheet-interface-pattern), JSP, and Cayenne would be a
powerful combination.
Joe
PS I have been using Cayenne for a few months now in development,
and it is one of the most stable components I have tested to date.