discuss the rationale for migrating your applications from Spring to Java EE 6 and show you real examples of upgrading the web UI, replacing the data access layer, migrating AOP to CDI interceptors, migrating JMX, how to deal with JDBC templates, and as an added bonus will demonstrate how to perform integration tests of you Java EE 6 application using Arquillian
EntityManagerClinicTest
There is also an interesting Arquillian Persistence extension that integrates DBUnit in Arquillian where you can define your test data externally
JDBC Templates hardly give any abstraction on top of the database and you’re on your own for Object Relational Mapping. We strongly advise to use JPA wherever possible; it gives portability by abstracting most of the database specific SQL that you would need, and it does all the hard and painful work of object mapping
CDI is a JCP specification included in Java EE
Weld is the reference implementation of CDI
Seam 3 is a set of modules which extend CDI to provide functionality beyond that offered by Java EE 6
Think of JSR-299 as the core of Seam 3 - it's the basic programming model for your application components, and for the built-in components that make up the Seam framework
Seam 3 is implemented as a set of portable extensions, or modules
run in any environment which supports JSR-299 (including any Java EE 6 environment).
BPM integration, Seam Security, Drools integration, RESTeasy integration, PDF and email templates, Excel generation, etc
2.0.0.Final
End of 2012
Full specification compliance
stop asking themselves how this solution could be improved upon
It's a very impressive magic trick, and I wish I knew how to do it myself. But then, I'm just not like that. I'm always trying to poke holes in things - whether they were Invented Here or Not.
but that might be too high-level for your taste. Their are other, less-abstract options.
exception handling, this is one area where Spring does a good job: "The Spring Framework's handling of SQLException is one of its most useful features in terms of enabling easier JDBC development and maintenance. The Spring Framework provides JDBC support that abstracts SQLException and provides a DAO-friendly, unchecked exception hierarchy."
Utter nonsense and dishonest false advertising
Automatic connection closing (and other boiler-plate code) is obviously a hard requirement to be handled by the fwk.
Pffffff. It's a trivial requirement which I can solve in my framework with two lines of code in a @Disposes method. Did you see any connection handling in the code above?
I mean, seriously guys. The Spring stuff is trivial and not even very elegant. I guess it's easier for me to see that, since I spent half my career thinking about data access and designing data access APIs. But even so...
I don't understand. You hate the ability to write typesafw SQL that much?
Gavin King
Methods with long argument lists are a code smell.
It's something Spring copied from Hibernate 1.x, back in the days before varargs
It's something we removed in Hibernate2 and JPA.
there are a bunch of people
who don't want to use JPA.
They don't understand, or see the value of, using managed objects to represent their persistent data.
Um. Why? Why would that be a bad thing? I imagine that any app with 1000 queries has tens of thousands of classes already. What's the problem? Why is defining a class worse than writing a method?
Are you working from some totally bizarre metric where you measure code quality by number of classes?