InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

WEB4J: Contrarian Web App Development for Java

Posted by Matthew Bass on May 05, 2009

Sections
Architecture & Design,
Development,
Operations & Infrastructure
Topics
Open Source ,
Java ,
Web Frameworks

WEB4J is a minimalist, opinionated, full-stack web framework for Java. It's "Java productivity without the pain.... because of [WEB4J's] deep simplicity, it allows markedly faster development of applications," writes John O'Hanley, the author of the framework.

According to the web site, WEB4J:

  • Embraces convention over configuration (similar to Rails)
  • Treats the data, not the code, as king
  • Doesn't force developers to learn new ways of doing the same thing
  • Doesn't rely on JavaScript, custom XML or annotations, or object-relational mapping
  • Doesn't impose thread-safety constraints on your classes
  • Enables implementation of forms in plain HTML

One of WEB4J's most intriguing features is that it allows placement of SQL in plain text files external to the code. The SQL is then referenced in the code using special objects. This makes DAO (Data Access Object) classes very compact.

WEB4J is small, only 88 classes in size compared to the 346 classes in Rails, 720 in Struts, and 2400+ in Spring. John claims that it takes a much shorter time to learn WEB4J than other frameworks.

The web site is very up front about the weaknesses of WEB4J, which include:

  • No library of user interface widgets
  • No built-in support for AJAX, Web Services, or Dependency Injection
  • Supports JSP/JSTL, but no alternative markup libraries like Velocity
  • Backwards compatibility with previous versions of the framework is problematic

A humorous YouTube video promoting the framework surfaced last year. The video portrays two programmers in an enterprise setting who discover the framework and use it to escape from the pain of their traditional J2EE projects.

WEB4J is open source, released under the BSD license, and includes a sample project in the distrubution

 

What? by Antonio Terreno Posted
Re: What? by Ramon Lima Posted
Re: What? by Antonio Terreno Posted
No Hibernate\JPA integration = FAIL by Rubem Azenha Posted
Hibernate = FAIL by Dan Howard Posted
  1. Back to top

    What?

    by Antonio Terreno

    With JSPs? With SQL files? Static calls to an object called DB? Actions like in webwork (i.e. usage of subclasses)?
    InfoQ is famous for posting high quality stuff, what's this?
    I would recommend something like Waffle in Java, and hey Java is anyway dead, try Lift not this legacy thing

  2. Back to top

    Re: What?

    by Ramon Lima

    I think it's good to have access to a simple plain java framework, not everyone wants to be in Scala :). I think I prefer to have access to MDA and reference plain java.

  3. Back to top

    Re: What?

    by Antonio Terreno

    Sure, Scala isn't for every one, however, have a look to waffle if you want to have something simple and cool, it's Java.

    waffle.codehaus.org/

  4. Back to top

    No Hibernate\JPA integration = FAIL

    by Rubem Azenha

    Hibernate\JPA is state-of-art of OO persistence.
    Trying to create a different way to do persistence in Java is probably a waste of time.
    I've no problem with brilliance and innovation, but I thought that the "hey, I've build another (redundant) Java Framework" wave (which I've participated) had ended for good.
    This thing really sucks.

  5. Back to top

    Hibernate = FAIL

    by Dan Howard

    Hibernate is a big lump of slow garbage. State-of-art LOL.

Educational Content

Jesper Boeg on Priming Kanban

In this interview, Jesper Boeg, author of the new InfoQ book – Priming Kanban, discusses the keys to using Kanban effectively, and how to get started if you are currently using other approaches.

New-age Transactional Systems - Not Your Grandpa's OLTP

John Hugg discusses high volume transaction processing applications with high and low frequency profiles, and how VoltDB can be used for that purpose.

Cool Code

Kevlin Henney examines code samples to see what can be learned from them starting from the premise that one won’t write great code unless he knows how to read it.

Collaboration: At the Extremities of Extreme

Jason Ayers share the observations he made watching a team of developers collaborating in real time on the same code base, pushing XP, pair programming and continuous integration to their extremes.

Yesod Web Framework

Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).

Transactions without Transactions

Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.

Attila Szegedi on JVM and GC Performance Tuning at Twitter

Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.