Hi Finn,

On Tue, May 31, 2011 at 4:19 PM, finbeu <info_pe...@t-online.de> wrote:

> I would like to build a facade in clojure and
> provide a jar file so that this clojure facade can be easily used by
> java developers that do not know anything at all about clojure
> (they're scared to death when I show them clojure code).



Is this possible? I mean in clojure we do not have "objects" and
> methods. So how would the java folks use my classes (the facade) that
> clojure complier produces?
>

You can generate Java classes via genclass for a final clean interface.

http://clojure.org/compilation


>
> What would be a good design of my clojure code so that it can be used
> easily by java developers? I'm somehow lost as clojure is not OO.
>

Protocols work well for wrapping OO code.
clj-plaza is a great example. It wraps Sesame and Jena frameworks.

Here are the definitions of the protocols:
https://github.com/antoniogarrote/clj-plaza/blob/master/src/plaza/rdf/core.clj
And an implementation:
https://github.com/antoniogarrote/clj-plaza/blob/master/src/plaza/rdf/implementations/jena.clj

Maybe write the wrapper in terms of Protocols and then write a thin
class with genclass providing an interface from Java.

Could you elaborate why you are writing this facade? Eliminating
boilerplate?
So it is easier to call from Clojure?

Ambrose

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to