Hi list,

The Google App Engine (GAE) Datastore is basically a collection of Entity
objects; an Entity is a PropertyContainer (map of name-value pairs)
extended to support a distinguished Key field.  Clojure fits with this
conceptual structure very nicely; the migae representation of the Entity
class uses deftype PersistentEntityMap, which behaves just like an ordinary
Clojure map.  (It also behaves like a map entry).  Only a few
datastore-specific operations are needed, so for the most part you can
completely ignore the underlying structure of Java classes and work
exclusively within a Clojure data idiom.

That's the theory, anyway.  The migae datastore lib
<https://github.com/migae/datastore> is still very much a work in progress,
but I've gotten far enough along to think that it will actually work, so I
think it's time to share it and solicit feedback and advice.  In
particular, I'm experimenting with various API design alternatives, some of
which are a little nutty - a major virtue of Clojure that I don't recall
every seeing mentioned is that it supports incremental design of new
abstractions on old libraries, thanks to the Java interop and other
facilities.  You don't have to cover the entire API at once; you can work
on small bits.  In any case, if you enjoy software API design you'll find
lots of interesting challenges in trying to put a Clojure face on the low
level Java Datastore API.

(It's possible to use the lib in an actual GAE application - see migae
<https://github.com/migae/migae> for a description of a technique for using
Clojure to develop GAE applications - but at the moment it's better thought
of as an R&D project for exploration.)

Implementation wise I could certainly use some help.  I'm afraid I don't
work with Clojure frequently enough to have developed a style, and I'm sure
my code exhibits lots of bad and naive habits.

You don't have to have a GAE account to explore it.  It uses Google's
gradle-based build system, which is rather nice; like leiningen, it will
download and install everything you need (in ~/.gradle).  To explore the
lib take a look at (and run) the unit tests - I've tried to design them not
only as tests but as documentation.  You can also use the lib in the repl,
thanks to the local testing environment that comes with the GAE SDK.

Cheers,

Gregg

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to