Our hesitation and voting about technology for persistence layer is over. There are two possibilities: stay on JPA or use JDO. JDO is better documented in Google documentation for App Engine. JPA is often used in many other project and is widespread. We doubted, whether JPA is right technology for us. I have read a few discussions on this theme, where JDO is recommended. I had problems with JPA configuration on the start of our project, it was second cause for doubt. But now it's obvious, it doesn't matter on technology, but only on skill. You can choose based on your personal preferences. We stayed on JPA and it looks like a right thing.
Many time was spent on project back-end design resolving. App Engine philosophy for persistence is simple and straightforward, but its not so ease change existing project. At first we had to embrace this philosophy and throw away relationships in database. Realy we don't need them any more, because we can't use them in Big Table. As well owned one-to-many relationships are problem, we need one Entity Group for like relationships.
I find nice data type Key for App Engine Datastore primary key, with this primary key type we can simulate many-to-many relationship. We are planning to look on EntityGroup for our owned relationships usage, it's not so good documented for JPA, it could be complication.
Last interesting thing I put to our project is JUnit for testing. Now we can develop in test driver way. It looks App Engine is very friendly for unit testing. There is many mock objects for mocking Datastore, Blobs, Memcach and etc. It's nice. Now I started with persistence testing. It works great and my colleagues have available examples, how to start with testing. I see it like a most important asset in project for this week.
pátek 4. listopadu 2011
Greeting for all readers! Our project is about sharing free time activity between friends and personal time management. We are in point, we have some functional basis of Android app and GlassFish based server side. Nowadays we decide migrate server part of project on Google App Engine infrastructure.
We implemented our first version of project based on AppEngine and moved from GlassFish. It was our first important step to cloud based server side of project. We are very excited and enthusiastic. Our next step would be composition of work done with our Android part of project.
If it looks like triviality to migrate from JPA basis on another technology or application server, but it wasn't. A lots of unexpected problems appeared. At first we decided to incorporate logging to out project. Log4j is very good choice, but it did not work for one day. The reason was comic, I badly configured log4j.properties file. One letter was forgotten in configuration for specific package logging: log4j.category. It was case when on one letter depends.
Second complication was quite similar, my configuration for persistence unit was wrong. File name persistance.xml with other letter substituted was big and curious problem.Exception thrown on that mistake was matchless and only logging saved me from fail during migration.
Finally we have GWT basis for client code, partly working persistent tier and native android client code. Our next steps should be put together AppEngine and Android. Second goal is upgrade of server side features and enable full functionality we had on GlassFish. There are some complications with ManyToMany and owned OneToMany relationships in BigTable. We are evaluating possibility of creation GAE part of project on Maven. Testing, automatic build and integration testing as well as adding library and dependencies for project are easy and cheerful with Maven.