Adam Bien's Weblog
My Top 3 "No XML" Frameworks
I just reviewed my past projects and noticed, that for about two years I almost completely got rid off XML configuration and deployment descriptors. It really works well, is efficient to develop, maintain and test. I especially appreciated working with:
- Wicket (Apache's Web Framework, from conceptual point of view similar to JSF)
- Google's Guice (I like especially the fluent configuration and only 22 pages of documentation)
- EJB 3 - No XML and just works. EJB 3.1 would be even better.
- [JPA] it rocks but comes with very small XML-configuration - so it should be out of scope here.
Posted at 08:30AM Sep 22, 2008 by Adam Bien in Java EE 5 Architectures And Idioms | Kommentare[16]
[my tweets]
Rss My book: Real World Java EE - Rethinking Best Practices


Good list. Also have a look at Stripes (http://www.stripesframework.org), a very good action-based web framework that uses the convention-over-configuration paradigm.
Gesendet von Jasper Fontaine am September 22, 2008 at 10:37 AM CEST #
Jasper,
thanks! I didn't used stripes in the last few months - but you are right, it should be on the list.
Thank you for your comment!,
adam
Gesendet von Adam Bien am September 22, 2008 at 12:11 PM CEST #
What about replacing XML with Java in build definitions? Maven and Ant use XML, but 'my' build tool uses pure Java:
http://code.google.com/p/pjmake
Gesendet von Thomas Mueller am September 22, 2008 at 01:35 PM CEST #
Thomas,
thank you for the hint. I will try it. Are you actually the man behind HSQLDB? If so, kudos to you!
thank you for your comment,
adam
Gesendet von Adam Bien am September 22, 2008 at 02:34 PM CEST #
> Are you actually the man behind HSQLDB?
Well, I am the original developer of Hypersonic SQL. HSQLDB is based on Hypersonic SQL. In 2000 I joined PointBase, and they told me I should stop Hypersonic SQL (the original plan was to continue). Then Fred Toussi forked Hypersonic SQL: HSQLDB. After I quit PointBase, I wanted to help HSQLDB again, but I found it's easier to start a new project - there are so many things I wanted to change... So I started the H2 Database Engine (see the link).
Regards,
Thomas
Gesendet von Thomas Mueller am September 22, 2008 at 05:18 PM CEST #
Then: Kudos to you because of H2! :-).
I only used HSQLDB and JavaDB in production. Both are really superb. Is H2 comparable with JavaDB regarding the compatibility and support for SQL? (I suppose the performance would be much better :-))
regards,
adam
Gesendet von Adam Bien am September 22, 2008 at 05:44 PM CEST #
@Thomas:
And your http://code.google.com/p/pjmake project seems to be a little bit empty :-). Is there already something to try-out?
regards,
adam
Gesendet von Adam Bien am September 22, 2008 at 05:45 PM CEST #
http://code.google.com/p/pjmake/source/browse/trunk/pjmake/src/tools/org/pjmake/Build.java
pretty cool, I am almost sure that everyone was already at a point and thought something like: "let me just embed 10 lines of java code right here... i really don't want to implement yet another task or 100 lines of obfuscated workarounds in ANT."
Gesendet von mbien am September 22, 2008 at 08:01 PM CEST #
> Is H2 comparable with JavaDB regarding the compatibility and support for SQL?
Yes. For details see http://www.h2database.com/html/features.html#comparison
> pjmake is a little bit empty
I change the project summary and added a download.
By the way I was at this years Jazoon as well, but unfortunately I couldn't come to your presentation... Next time!
Gesendet von Thomas Mueller am September 22, 2008 at 09:44 PM CEST #
I started using H2 in unit tests but had to stop because the SQL was not completely compatible. I would execute all the .sql upgrade scripts from the first version to the latest to build the db before using DbUnit to insert test data. Some postgres syntax related to nextval('sequencename') isn't supported, create role doesn't fully support postgres syntax, etc. I didn't want to maintain separate scripts for H2 so I had to use a dedicated postgres sever for integration tests.
I noticed H2 has a feature where you can tell it to emulate Postgres. It would be great if you could fully support the syntax so that it is usable in unit/integration test environments.
Gesendet von Ryan am September 22, 2008 at 10:14 PM CEST #
Why don't you give Spring 2.5 and Hibernate Annotations a try. You have the same functionality but with Stereotypes and JPA annotations. The best of both worlds.
Gesendet von Omar am September 23, 2008 at 05:16 PM CEST #
> SQL was not completely compatible
I am sorry, but it will take a while until such problems are resolved. I try to make H2 compatible to other databases, but it is not possible to reach 100% compatibility. It would be just too much work. The only suggestion I have is: try to make the application less database dependent :-) Still it would be good to know what exactly doesn't work. You you send me details to the support address (dbsupport at h2database) or to the Google Group?
Gesendet von Thomas Mueller am September 23, 2008 at 10:02 PM CEST #
Omar,
I would always use Hibernate as JPA provider and try not to be dependent on it. EJB 3 are just available on every Java EE 5 server, so it's the obvious choice. In case they will for some reason not work well enough, I can still introduce Spring. (http://www.adam-bien.com/roller/abien/entry/what_happens_if_you_start)
thank you for your comment!,
adam
Gesendet von Adam Bien am September 24, 2008 at 07:30 AM CEST #
@Thomas
Excellent job on H2! I replaced HSQLDB with H2 for my previous company... we provided a desktop "web" app that needed to store stuff locally, so I bundled H2 and it worked great!
I am really curious about the use of your java coded build system. I've always wanted to do it in code instead of using ant/xml. Seems your methods are similar to the "tasks" ant provided. But it does look like you have to code some things that were done for you via Ant, such as file paths... not that it's a bad thing, just wondering if you have or are planning on some utility methods to abstract some of the more commonly done things besides compile/jar/clean.
@Adam
If you haven't yet checked, take a look at JSR-311 and Jersey for a very nice and surprisingly easy to use REST framework! It is superb. No config, all annotations, and very quick, minutes or so, to build/deploy a REST ready app. Even supports JAXB bindings that accept/respond with xml and/or JSON all automatically.
Gesendet von Kevin am September 25, 2008 at 01:21 AM CEST #
Adam
Looking forward to those EJB 3 and Google's Guice posts :)
Gesendet von Jon am October 18, 2008 at 06:58 PM CEST #
Hi Adam,
as recently discussed I completed my little series on Guice with a post on the integration of Guice and EJB:
http://musingsofaprogrammingaddict.blogspot.com/2009/03/guice-tutorial-part-3-integrating-guice.html
In the post I demonstrate how to perform DI using Guice within session beans with the help of an EJB interceptor. It is also shown how to unit test EJB applications using the embeddable OpenEJB container.
So I'd be happy on any feedback and comments,
Gunnar
Gesendet von Gunnar am March 09, 2009 at 10:35 PM CET #