At the moment I am already home, we had a long drive from 10 hours, a good night sleep, and a day at work. I owe you all the report of the last day at the JAOO and maybe some final thoughts.
This post tells a story about jpa and internal domain specific languages, read on if you want to learn more.
The first presentation I saw this day was by Patrick Linskey. He talked about JPA, a short introduction of jpa 1 and some features of the upcoming jpa 2.
One thing I liked about the overview of jpa 1 is that I actually learned some new tricks. The best trick I missed completely before is the getReference method. When programming a delete method I used to load the object first before deleting it. This is not very optimal. I did not know of the existence of the getReference method.
<T> T getReference(Class<T> entityClass, Object primaryKey)
Using this method you can program your delete method like this:
What I remembered from the presented new features is the inclusion of features in the specification that all implementations already have. Think about features like: cache handling, logging sql statements, creation of schema. Another new feature is pessimistic locking next to optimistic locking.
The final thing I want to mention is a project that is an abstraction (or dsl like Microsoft Linq) for querying collections or entity managers. This project looks promising. It is still young, I’ll get back to this when I have actually tried it.
The last talk I attended was presented by Martin Fowler. Man he was fast, I did grasp the basics of domain specific languages (DSLs). Martin was talking about a book he is writing. The focus was on internal DSLs. I mentioned Linq before, I like the idea. So I will do some more research. I am not going to try to explain what it is about, check the following website of Martin if you want to learn more. Focus on fluent interfaces and builders on top of normal domain type of objects.
The end of JAOO