Hi,

for a project, I would like to use a Java framework that exposes a
very Javaesque API, with dozens of classes that need to be
instantiated or used and with several interfaces that one needs to
implement in order to be called back by the framework.  The interfaces
are particularily cumbersome, as most of them only specify one or two
methods.  Now, exposing the innard of this library to my application
is something I'd like to avoid, as the object oriented API does not
mix well with a purely functional development style.  On the borders
of my application, though, I will have to cope with the classes and
objects.

How do others approach this kind of problem?  Are you just ignoring
the functional vs. object oriented mismatch and access Java objects
from everywhere?  Do you use hand-written wrappers around the
libraries?  Tools?

In my case, most of the interfaces are trivially small (provide only
one or a few member functions to be called back by the framework).  A
macro wrapping up clojure/proxy a little nicer will do the job,
although I would still like to provide purely functional interfaces
and have the interface mechanics be hidden from the Clojure
application.  For the larger classes of the framework, it would be
useful to somewhat mechanically translate objects in hash tables, so
that getters can be conveniently called.

Certainly, I would like to spare myself having to type in the names of
dozens of accessor functions and corresponding hash table keys.  What
would be a good approach to automating this?  Use reflection on the
classes and generate the functional interface?  Would that be a
function called at the REPL that results in a file that is manually
edited, or would one do that at compile time and just generate a
richer and more complete interface?

Any thoughts on this would be greatly appreciated.

Thanks,
Hans
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to