středa 9. listopadu 2011

Persistence progress and unit testing

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.

Žádné komentáře: