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:

  1. Wicket (Apache's Web Framework, from conceptual point of view similar to JSF)
  2. Google's Guice  (I like especially the fluent configuration and only 22 pages of documentation)
  3. EJB 3 - No XML and just works.  EJB 3.1 would be even better.
  4. [JPA] it rocks but comes with very small XML-configuration - so it should be out of scope here.
Especially the integration between EJB 3 and wicket and EJB 3 and Google's Guice are superb (I will write some posts about that). I like JSF as well, however the amount of XML configuration is still huge. JSF was designed from the tool perspective, so it isn't a problem with a good tool (like Netbeans or JDeveloper). ...already looking forward to JSF 2.0 :-).

Comments:

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.

Posted by Jasper Fontaine on September 22, 2008 at 12:37 PM 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

Posted by Adam Bien on September 22, 2008 at 02: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

Posted by Thomas Mueller on September 22, 2008 at 03: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

Posted by Adam Bien on September 22, 2008 at 04: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

Posted by Thomas Mueller on September 22, 2008 at 07: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

Posted by Adam Bien on September 22, 2008 at 07: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

Posted by Adam Bien on September 22, 2008 at 07: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."

Posted by mbien on September 22, 2008 at 10: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!

Posted by Thomas Mueller on September 22, 2008 at 11: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.

Posted by Ryan on September 23, 2008 at 12:14 AM 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.

Posted by Omar on September 23, 2008 at 07: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?

Posted by Thomas Mueller on September 24, 2008 at 12:02 AM 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

Posted by Adam Bien on September 24, 2008 at 09: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.

Posted by Kevin on September 25, 2008 at 03:21 AM CEST #

Adam

Looking forward to those EJB 3 and Google's Guice posts :)

Posted by Jon on October 18, 2008 at 08: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

Posted by Gunnar on March 09, 2009 at 11:35 PM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License