Mike Keith (Oracle) – Taking JPA to the next level
Mike introduces the new features of JPA 2.1 (the specification is available a final draft):
- Query enhancements (minor things for SQL geeks)
- Criteria API bulk operations
- Calling StoredProcedures
- Adding named queries at runtime
- Converters: @Converter, @Convert (like user-types in Hibernate; single-column only)
- Unsynchronized persistence context (changes won’t get flushed to the database unless explicitly stated; e.g. for long-running conversations)
- Entity Graphs (fine-grained fetching strategies per entity)
There two interesting things are Converters (I am really surprised that this is not supported by JPA yet) and Entity Graphs (sounds like a pretty useful optimization option).
Besides that, there are no really big features – most of the enhancements are for pretty special usecases (low-level things that you usually should avoid when using an O/R mapper).
Jon Brisbin (Springsource) – Spring Data REST
Spring Data REST aims to provide “CRUD over HTTP” without all that boilerplate code that is usually needed for repositories and REST services. It uses Spring MVC and Spring HATEOAS, and integrates with the “Spring data” mappings (like JPA, MongoDB).
Spring HATEOAS (awful acronym, never heard of it before) provides a basic REST abstraction (which includes discoverable resources) – the JSON string of a HATEOAS resource consists of a “content” object (the actual resource data) and a “links” object that describes how to go on from here.
Slides are available at http://bit.ly/confess2013-spring-data-rest.
Haleby/Severson (Jayway) – Java Functional Frameworks
An evaluation of three frameworks that aim to bring some functional features to current Java versions:
- Functional Java (inspired by Scala) – an API on top of the JDK (or rather “beside”, because it uses its own collection framework). Very powerful, but an awful syntax (every function is defined within an anonymous class, which means that the actual code is buried under loads of syntax) – to improve this a little bit, such boilerplate code can be hidden in static constructs.
- LamdaJ – dynamic function creation using proxies. Very short code, but hard to read (i.e. hard to find out what the code actually does).
- Guava – a collection of Java libraries with some functional features. Nice fluent interface, but the syntax is similar to “Functional Java”, yet not so powerful.
These frameworks are nice if you want to play around with functional stuff, but are no replacement for built-in functional constructs – the disadvantages of each framework (syntax, speed, API) outweighs the advantages (of functional programming in general) by far.
Heinz Kabutz – Secrets of Concurrency
Threading is a very complex field, there are many ways to make it wrong (and only a single way to do it right). Heinz presents an (incomplete) list of things you should think of (and have to deal with) when implementing concurrent stuff, like
- Dealing with InterruptedExceptions
- Immutable objects
- Dealing with large amounts of threads
- Reordering of statements (“early writes”)
- Object locks, synchronization
- Thread contention…
General recommendations are: Read the specifications (like JVM, JMM); always test and verify (e.g. using “synchronized” is not necessarily slow).
Johan Haleby (Jayway) – REST-assured
REST-assured is a neat, Groovy-based framework for testing REST services with a BDD-like syntax (given/when/then). It provides a easy and powerful way to validate JSON and XML (and even HTML) responses.
Note: Johan has used Scalatra to implement the REST services for the demo – I should check this out…
Petr Jiricka (Oracle) – HTML 5 and JavaEE 7
A talk about the architecture of modern, JavaEE-based web applications:
- Communication is done with HTTP-enhancements (Websockets for bi-directional communication, server-sent events)
- On the server: JavaEE 7 (Servlet 3.1, JAX-RS 2.0, WebSocket 1.0, JSON-API 1.0)
Pretty obvious things, no big surprises. But it was very nice to see how much the IDE (in this case NetBeans 7.3) can support the development – especially the support of client-side technologies is astonishing (debugging in the browser and even on remote devices, inspecting and changing the client at runtime...).