That sounds quite interesting, Clinton. I'll look forward to it.
In the framework we use now ("Anvil"), the frontend calls into a
business facade (aka a set of services), that invoke a command, which
may actually be a chain of commands. Some of the commands delegate
directly to an iBATIS mapping, others don't touch iBATIS, and several
will retrieve the data and massage it before passing it back. The
commands pass around a context, and each command will place its
outcome into the context under its own name. When the context is
passed back, it may contain several datasets. A common use case for
multiple datasets is populating several select controls. A set of
"controller" commands also handle server-side validation and
formatting for us.
iBATIS is a key component, and our lowest-level component, but it is
only one component. Right now, we're using three layers of
configuration, which I would like to reduce to one layer, preferably
in JavaScript object-literal notation (JSON).
We've been using the framework in production for over a year, and this
is that third major release that uses it. To cope with Ajax, we
swapped in a JSON-RPC facade (via Jayrock), and the rest remained the
same. But, I'd like to reduce the churn needed to program the
framework by flattening the configuration.
-Ted.
On 6/11/07, Clinton Begin <[EMAIL PROTECTED]> wrote:
LOL, dude, I've been doing iBATIS Javascript demos at my last few
conferences.
I used a bridge approach. A generic servlet that acts as a gateway to
iBATIS. So you write SQL Map files and config as you normally would. Then
set up the gateway servlet. Done. No Java code.
You can then call mapped statements by making typical XHR requests via your
favourite framework (Prototype in my case). You send url encoded paramters
(GET or POST) to make a request, and get XML back. I did a little tweaking
within the servlet to merge the XML results into a single document (instead
of a list of documents).
But it actually works very well. It's not production ready, and a
JavaScript API mirroring the Java interface would be awesome and easy to do.
JSON support would also be inevitable and also easy.
I'll find somewhere to post it this evening for peer review.