Java Champion / JavaOne Rockstar Adam Bien (adam-bien.com) is a self-employed consultant, lecturer, software architect, developer, and author in the enterprise Java sector. He is also the author of several books and articles on Java and Java EE technology, as well as distributed Java programming. adam has posted 59 posts at DZone. View Full User Profile

My Top 3 "No XML" Frameworks

09.22.2008
| 7309 views |
  • submit to reddit
I just reviewed my past projects and noticed that for about two years I've almost completely managed to get rid of 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 more about that soon). 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 IDE or JDeveloper). ...already looking forward to JSF 2.0 :-).

From http://www.adam-bien.com/roller/abien/

AttachmentSize
fig-1.jpg8.74 KB
Published at DZone with permission of its author, adam bien.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Roger Marin replied on Mon, 2008/09/22 - 5:53am

 I would be nice to see a tutorial on writing an app with Wicket,EJB 3 and Google's Guice, it seems like a really good combination, and no XML!

Mark Unknown replied on Mon, 2008/09/22 - 8:04am

Title is a "little" misleading. You still have "XML" in Wicket albeit HTML. Personally, I dislike that more than xml config.

kenjobonesnapper replied on Mon, 2008/09/22 - 8:22am

Seam greatly reduces the amount of XML JSF requires. I'd have it top of my list, along with EJB3 and Guice as well which you've mentioned.

John Denver replied on Tue, 2008/09/23 - 9:07am

The only problem with EJB3 now is it is difficult to get it working on Tomcat with many dependencies but I know EJB3.1 will fix this.

Also I would say Tapestry 5 is a great project without XML, it use annotations  and have its own DI.

I try Wicket and Guice together and it rocks. It is easy to use Wicket with EJB3?.

I think JSF2 will rock, JSF1.2 it is ok the xml configuration for navigation I like it actually with IntelliJ IDEA I can see graphically the flow of my pages but the problem is JSP with JSF that is horrible I like much better Facelets.

Regards.

Gerd Ziegler replied on Tue, 2008/09/23 - 2:36pm

If you like take a look at this zero XML Java Web framework: http://www.ztemplates.org that also has AJAX form processing support.

Omar Palomino S... replied on Tue, 2008/09/23 - 6:56pm

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.

John Denver replied on Wed, 2008/09/24 - 12:51am in response to: Omar Palomino Sandoval

Dont give a try to Spring check this article why :

http://java.dzone.com/articles/springsource-and-lost-tag

 I think Spring lost its Mojo.

Anyway Hibernate and JPA it is good actually you can use Guice with Hibernate or EJB3 with JPA.

Albert Buława replied on Wed, 2008/09/24 - 2:21am

I am amazed how many people hate XML so much that they are all ready to pollute their business logic code with framework specific annotations thus introducing unneeded container and/or framework dependencies.

I understand using standard annotations like JPA or EJB3 ones but making my business logic dependent on some Guice or other framework-du-jour just to do DI? XML is tedious and annoying, yes, but it's still obviously a better choice than introducing martian dependencies into the code.

Omar Palomino S... replied on Wed, 2008/09/24 - 10:59am in response to: John Denver

I'm sorry if this offend some sensibility out there, but that seems to me as YASLD (Yet Another Stupid License Discussion). C'mon guys, I thought this is DZone, not Slashdot. :(

Gerd Ziegler replied on Wed, 2008/09/24 - 2:44pm in response to: Albert Buława

Well, think you always depend on something... XML is a horror because you have no good tool support. Ever tried refactoring a Spring application with lots of beans scattered around in xml files? Change a setter name, add a parameter to your constructor and it breaks down. XML like that is just programming in another language, without compiler support.

Otengi Miloskov replied on Thu, 2008/09/25 - 1:04pm in response to: Omar Palomino Sandoval

How I miss the old days when JavaLobby was actually JavaLobby now is just DZone.

Omar Palomino S... replied on Thu, 2008/09/25 - 1:15pm in response to: Otengi Miloskov

Agree.

Jose Maria Arranz replied on Fri, 2008/09/26 - 2:43am

Have you tried ItsNat, Natural AJAX?

  • 0% custom tags/view-metaprogrammin
  • 0% XML based configuration,
  • 0% annotations
  • 0% code in the view
  • pure X/HTML/SVG templates
  • full control of the view layout using Java
  • AJAX centric
  • compatible with the venerable Java 1.4. 

 

Albert Buława replied on Mon, 2008/09/29 - 5:07am in response to: Gerd Ziegler

I surely depend on the air I am breathing but Java frameworks are no air. While XML configuration has some downsides, modern tools support refactoring (my, even basic Eclipse lets you refactor non-java files). I agree that XML configs could be supported much better and I believe that this is the right way: to improve support for external configuration, be it XML or another format, not to "get rid of XML" and invite unnecessary dependencies.

Also, the broken window effect is not to be forgotten. Having already needlessly coupled various unrelated parts of the application to an external library, it takes much less hesitation to introduce another dubious coupling or otherwise decrease code quality. And so the story goes...

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.