But I started to use play! [2] as backend productivity machine and objectify was not that well supported. So - just out of curiosity - I tried to use Siena [2]. A mapping layer promoted by the play! team - especially for the excellent GAE support.
And I immediately liked siena:
Model classes look like:
public class TextPage extends EnhancedModel { @Id(Generator.AUTO_INCREMENT) public Long id; public Project project; public String longitude; public String latitude; public Listpictures; public List textpages; public Layer layer; }
Pretty simple. They simply extend a EnhancedModel and have a @Id. Project "project" is another model and referenced as key. The rest should be self explanatory. And yes - I know it's a bad style to use publics...
Querying the db is as simple as:
TextPage textpage = TextPage.all().filter("id", 343).fetch();
You can find more about the usage on the excellent tutorial at [4].
All operations are all very RESTFul. That's of course not a feature of siena, but in general a cool thing of NoSQL. It simply works like the web works in general. Delete, Update, Create and that's it.
It was a really pleasant experience developing with siena. And I am pretty sure it will not be my last project.
The other cool thing about Siena is that it’s not limited to GAE. It aims to provide a NoSQL query interface also for SQL databases and other NoSQL databases like Redis. And that's really something that's unique about Siena. It aims for minimal vendor lock-in. And it aims for providing the same feeling on different DB methodologies. Great news :)
Currently there is support for: MySQL/Postgres/H2 in the SQL world and GAE, Redis (and soon MongoDB and HBase, SDB) in the shiny NoSQL world.
Another great thing is that Siena's main developer, Pascal is helpful. And - he was so kind to give me a little interview about his motivations to develop "yet another persistence layer":
To be or not to be
me: first question: why are you developing siena?
(is this related to play)?
pascal.voitot.dev: It's a kind of accident
I was looking at play
because i've been studying all lighweight web frameworks for Java
and I couldn't find anything as I wanted
until I found Play!
Then as I'm really not a big fan of JPA/Hibernate and wanted something looking like DB layers in Rails
I began to look at siena
and then GAE because I wanted to experiment it
and I began using play+siena
found it was quite good
then I developed play-crud-siena just for fun to test play extension mechanism
and by doing this, I really discovered siena deeper and deeper
and had contact with the creators of Siena project directly
to ask them questions, correct a few things
and after some time, it appeared the creator of the project couldn't work on it anymore
and looked for someone to lead the project
me: hooray
pascal.voitot.dev: and I accepted
and since, as I believe in this little project
I rewrote lots of things
added lots of things
plugged it better into play! etc...
me: nice
pascal.voitot.dev: I write the DB layer I would have liked
About unique features of siena
what do you think are the unique points of siena...
I mean... there is JPA, JDO, hibernate, objectify, twig, etc pp
What is unique?
,.--.,
pascal.voitot.dev: not easy isn't it?
me: don't get me wrong... that's a question I have already answered for myself..
but what do you think about it as lead?
pascal.voitot.dev: first it tries to draw a bridge between SQL and NoSQL
it's an experiment on this point because lots of people think it's not possible... I think it's possible in 80-90% of the cases
moreover, Siena is using the activerecord pattern
which is quite practical
your object knows themselves and it's quite logical
and siena is aimed at being simple
no transaction
stateless by default
you can have transactions and be stateful but it's not the default case
me: yea...
that is exactly what I also think is the strong point of siena....
pascal.voitot.dev: and I drive the development in a way I'm experimenting
I ask myself:"I would like to do that... how would I like to code it simply?"
no from the technical ground to the user
but from the user to the technical ground
me: yea...
pascal.voitot.dev: we are also working on other NoSQL implementations
GAE is good but we need to prove the siena design is ok to work for other DB
we are currently working on a REDIS implementation
it's really promising
me: great
Server technology and play!
me: what about play?
pascal.voitot.dev: great stuff
i'm a big advocate of light servers
light java
and play was a breath of air to me
pascal.voitot.dev: because I was beginning to feel like going out of java
me: really!
me too
i like the tooling...
but java + jsf + xyz is just so broken
pascal.voitot.dev: "I must still earn my money with over-complicated things like JEE heavyweight solutions or even crazier portlet containers"
me:we are currently founding a company..
a tech incubator and a consultancy...
and we are doing a lof of GWT
but all the freaking backend is missing..
and the complete java stack is too complicated...
broken..
pascal.voitot.dev: and does play fit this usecase?
me: 100%
pascal.voitot.dev:
great!!!
Java has one strength
the JVM
me: jepp
and tooling
tooling
tooling
pascal.voitot.dev: and opensources APIs
me: jepp....
About Spring and Enterprise technology in general
pascal.voitot.dev: but never go in JEE or Spring
me: I tried roo...
but that's also a monster
pascal.voitot.dev: Spring roo
oh yes!!!!
I tried just before finding Play
in fact, it was my last try before leaving java web world
Roo is a monster
me: also my bet
pascal.voitot.dev: AOP is great on paper
ROO made me crazy because the idea is good
the realization is horrible
me: i guess roo is not yet mature...
it will take another 2 years or so..
pascal.voitot.dev: I think they have a big big big design hole in the middle
the generated AspectJ is simply a fault
you don't control anything
you have code you can't modify because nobody can code in AspectJ
compared to Play!, it's not really a good idea IMHO
me: also my bet...
play is so much better...
it's like nosql vs. rdmbs
both has advantages and disadvantages...
pascal.voitot.dev:
me: ok..
bad comparison...
i mean...
pascal.voitot.dev: yes
me: ok...
forget it...
play is for fast development of real world applications...
pascal.voitot.dev: I feel like play had a target
and it reached its target perfectly
me: spring + servlets + jsf + aop is more like for a big bank company that plan a project for years in advance...
and go 100% by the specs...
pascal.voitot.dev: yes and I really think this is not the right way to go...
me: nope...
old school
pascal.voitot.dev: when you begin to have a problem with a JSF atg
tag
what do you do?
just hacks
me: jepp...
pascal.voitot.dev: and Spring was so clever
in 2004-2005
me: YEA!
2004-2005!!!!
pascal.voitot.dev: now it's like Oracle JEE server
me: totally agree
Thanks Pascal for the interview and all the best for the project :) Check it out: https://github.com/mandubian/siena/
[1] http://code.google.com/p/objectify-appengine/
[2] http://playframework.org
[3] https://github.com/mandubian/siena
[4] https://github.com/mandubian/siena/blob/master/source/documentation/manuals/first_model.textile