Over a million developers have joined DZone.
Platinum Partner

Interview: Jose Noheda on the IWebMvc Framework

· Java Zone

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.

IWebMvc, the web framework that announced its Milestone 5 release a few days ago, is part of a (very) crowded field. However, its combination of Dojo/Hibernate/Spring/DWR and, potentially, Groovy, makes it, at least, interesting. Recently, its author, Jose Noheda, discussed the crowded web framework field in his blog and, to find out more, Javalobby interviews him, below. (Click here for downloads, including screencasts.)

Jose, yet another web framework! Why, oh why?

Web frameworks in Java are a dime a dozen nowadays, that's for sure. Each targets different kinds of people, though. A framework like AppFuse seems to focus on project kick start; Click on component oriented design; Grails on Groovy, etc. Last week I read about Web4J a new (commercial) framework that won't give the developer any kind of help with AJAX.

Each has an audience. IWebMvc fills a void offering a modern and robust server-side solution, based on JEE5, Spring 2.5, and Hibernate-JPA, along with a completely integrated AJAX frontend. Other projects offer DWR integration and some may include a Dojo plugin, but they were not designed with them in mind and it shows! IWebMvc has considered, from the start, managing client-server communications as a central piece of the work. In addition, being a committer of DWR gives me an edge, as I can integrate features between both projects in a way no other developer could.

Of course, all web frameworks provide several key features, such as CRUD, i18n, binding, and validation. That may be seen as reinventing the wheel sometimes.

In a nutshell, can you specify three reasons why I would use IWebMvc?

  • Out-of-the-box functionality
  • Complete predefined stack. No plugins, no considerations, tight integration, less troubles
  • State-of-the-art: AJAX, Spring 2.5.4, Spring Security 2.0, Spring Webflow 2.0, Dojo 1.1.1, Google APIs...

There's nothing better out there!

In what ways do other frameworks not provide these features?

I've already talked about DWR integration and how it cannot be matched (in fact, IWebMvc is the only framework that packs v3 right now). A couple of days ago there was a discussion on the Dojo mailing list about the lack of MVC features (frameworks) available for Dojo. IWebMvc was mentioned as a powerful alternative.

Plus, IWebMvc wraps dijit in extended widgets that integrate other technologies like Flash or Google AJAX APIs. I'm pretty sure I'm alone here as well.

Of course, the backend layer is crowded but IWebMvc is on par with other frameworks, integrating Spring, JPA, TX, AOP, Security, CRUD, flows...

Can you run us through a step-by-step quick start?

Installing everything could not be easier. Just download and unpack or checkout from Subversion. IWebMvc provides working build scripts based on Ant+Ivy. It will manage transitive dependencies transparently. No hassles.

Running the demo application is equally simple as it includes an Ant target (that can be launched from a batch file in Windows) that executes an embedded Jetty server. Here it is deployed in Eclipse:

A developer can inmediately open the project in both NetBeans 6.1...

...or Eclipse 3.3:

...and deploy to either Glassfish or Tomcat. Once deployed, the framework will create the DB schema automatically, so again no additional work there (just create an empty database if using MySQL).

Note: In IWebMC, the framework code is next to the application code. There's no real separation. This is so that any developer can change a framework class/widget/tag/JSP as if it were part of the application. In the final release, three versions will be available: one with the framework expanded, one with the framework packaged as a JAR (inside WEB-INF/lib), and one with the embedded demo application.

From the above situation, users are encouraged to browse the demo application and see the functionality. The next step would be to create a domain entity and test the automatically generated CRUD operations.

For example, this simple POJO is written in Groovy. Notice how easily widgets are integrated:
@Table(name = "ITEMS")
@NamedQuery(name = "Item.findAll", query = "SELECT i FROM Item i")
class Item extends AbstractDomainEntity {

@Column(name = "REFERENCE")
@StringConstraint(minLength = 1)
String reference

@JoinColumn(name = "COMMERCIAL")
@ManyToOne(fetch = FetchType.EAGER, cascade = [CascadeType.ALL])
I18nText name

@DateConstraint(maxValue = DateConstraint.DateLiteral.TODAY)
@Column(name = "DATEPACKAGED")
Date packaged

Rating quality

@JoinColumn(name = "WAREHOUSE")
@ManyToOne(cascade = [CascadeType.ALL])
Address storeLocation

@JoinColumn(name = "PHOTO")
@ManyToOne(fetch = FetchType.EAGER, cascade = [CascadeType.ALL])
Image image


The above code will automatically get a developer (in less than five minutes):
  • DB schema update
  • Full text search & filtering
  • Data in several languages (as many as defined)
  • Validation (on string, date and object fields)
  • Create, Read, Update, Delete operations
  • Two (customizable) pages to operate
  • A secured URL

See one screenshot (fields may be arranged differently using a custom page instead of the default):

Or try a Groovy Script and avoid having to redeploy!

Can you compare & contrast IWebMvc with the following alternatives: JSF, Struts, GWT, Wicket.

  • JSF: IWebMvc provides client side components based on Dojo widgets, gets AJAX thorugh DWR, binding & validation through Spring and a backend bean that is a POJO annotated using JPA. I've never liked JSF.
  • Struts: IWebMvc relies completely on Spring MVC so any comparison between them applies here.
  • GWT: IWebMvc provides all the needed JS for the developer. There's some work going on between DWR & GWT so I may include some kind of support in the future...
  • Wicket: Here we have an apples to apples comparison. It can be a matter of taste, in IWebMvc you won't see any code like add(new Label("counter", model));. Of course, the stack is different and for people used to Spring MVC and Dojo, probably IWebMvc fits more naturally. And you can code in Groovy! Wicket is an Apache project though...

Why is it named IWebMvc?

The "I" comes from Internna, a company I founded in 2005. The rest, well... I need a marketing advisor. :-)

When and how did you start working on this framework?

Middle of January 2008. The first release took about six months, since I had built similar architectures before. I was in the process of changing jobs and had a lot of free time. I was happy with how things were shaping so I continued.

Are there others involved in the project?

Just me. I'm open for contributions and help!

What's the timeline for upcoming releases and what do you expect them to provide?

IWebMvc provides a good number of features by now. More than 40 widgets! I encourage any interested developer to take a look at the screencasts recorded (http://code.google.com/p/internna/downloads/list). They show most of the client-side features. So, I've frozen the code base. During the last six months my main concern has been adding functionality. These have shifted and I'm just worried about squashing bugs and getting a 1.0 release that is production ready. I expect to have a RC in 10 days and a final release before the end of June.

The Java Zone is brought to you in partnership with ZeroTurnaround. Discover how you can skip the build and redeploy process by using JRebel by ZeroTurnaround.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}