October 05, 2006

ParaNamer support in Waffle as an alternative to annotations

The latest release of Waffle (0.7) can now fully support ParaNamer as an alternative to annotations. ParaNamer provides "method parameter name access for versions of Java PRIOR TO Java 7.0". ParaNamer combined with Waffle will allow you to utilize your ActionMethod parameter names directly. In the example below Waffle will use "itemId" and "quantity" to resolve the arguments for the void removeFromCart(Long, int) action method.

public class ShoppingCartAction implements Serializable {  

// No annotation is necessary when utilizing ParaNamer
public void removeFromCart(Long itemId, int quantity) {
cart.remove(itemId, quantity);

For complete details on this please see the documentation on Waffle ActionMethods.

October 04, 2006

Describing Waffle with one picture

The Waffle team has been busy over the last few months adding features and simplifying the overall design. Much of the documentation has been updated to reflect these changes. Many times however, it is easier to describe something with a simple drawing or a picture. So have a look at the following to get a clear idea of what Waffle provides:

Ruby on Cygwin error (*** unable to remap)

I had an annoying issue occuring when running Ruby under Cygwin. The error was reproducable every time that I attempted to run the ri command.

C:\cygwin\lib\ruby\1.8\i386-cygwin\readline.so to same address as parent(0x370000) != 0x2760000
C:\cygwin\bin\ruby.exe (3132): *** unable to remap C:\cygwin\lib\ruby\1.8\i386-cygwin\readline.so to same address as parent(0x370000) != 0x2760000

I was finally able to resolve the issue with the following steps:

  1. exit from cygwin

  2. enter the dos command prompt

  3. cd to you cygwin bin directory (c:\cygwin\bin)

  4. run ash rebaseall

  5. restart cygwin ... problem solved

June 19, 2006

Waffle: define a default event in your Action

Waffle now provides a new DefaultEvent method level annotation for use in your Actions. This allows you to mark a particular method as the default event to fire when no other event was signalled. This is particularly useful when a user is directed to a page for the first time. Until now, the previous page was responsible for setting up for the page that preceeds it. Either that or all links within your application would be required to define exactly which event should be triggered through request parameters (e.g. "/application/myaction.htm?EVENT=init|{request}").

The following Action example (MyAction) has its init(HttpServletRequest) method annotated as the default event.

public class MyAction {
public void init(HttpServletRequest request) {
// ...

Notice the value "{request}" set on the DefaultEvent annotation. This provides a hint to Waffle to help it satisfy the method arguments. If you are familiar with Waffle you should realize that this is similar to how events are defined from Views. This in fact is not just similar it is identical. You can define the event arguments for the DefaultEvent annotation in the same way described in the Advanced Events section of the tutorial.

April 19, 2006

Waffle on TheServerSide.com

Waffle was recently posted on TheServerSide.com under the heading Another Rails-like web framework: Waffle. I was happy to see it posted and really appreciated the responses from those that are interested in Waffle.

I'm grateful for the comparison of Waffle to Ruby on Rails but Waffle is NOT a Java version of Rails. I think the only viable comparison I can make between Waffle and Ruby on Rails is:
  • convention based
  • simplicity
  • both take advantage of their respective languages
  • increased development productivity
Many, if not most, of the clients I consult at have made a significant investment in either Java or .NET (specifically C#) and for that reason alone Ruby on Rails is not a viable option. So next time you are about to begin work on a Java based web framework make sure you take a look at Waffle.

March 28, 2006

Try using FreeMarker to generate XML documents

Generating XML from code is a very common development task. There are a multitude of ways it can be accomplished. Recently, at a client, we needed to generate an XML message which had to conform to a rather complicated XML schema. We already had an object model that worked well with our code base. We considered using XML binding API's like:
Each of these had its own limitations which reduced their feasibility within our application. Next we considered hand-coding the XML directly with API's like:
The amount of code required to create an XML document with these API's was excessive. Code like this was not fun to write nor easy to follow.

So we decided to take a different approach and use a templating engine, specifically FreeMarker. Using FreeMarker to generate the XML response messages turned out to be a great decision. This is a list of some of the advantages we have noticed:
  1. The FreeMarker template we wrote to create the XML response message is an XML document. This simple fact should not be overlooked.
  2. Easy to integrate into any application. Very little code was required to utilize FreeMarker in our application.
  3. Excellent performance.
  4. The built-in functionality that FreeMarker provides is very powerful.

Tutorials for Waffle

I have been spending my free time updating Waffle with functionality and documentation. Two tutorials have been added to the Waffle web site which should provide a good overview of how to use Waffle and what makes it different.

The examples in the tutorials show how to use Waffle with JSP's. This was done based on feedback I have had when talking about Waffle with developers. At this point you should get latest Waffle code directly from subversion and build it with Maven 2.0.

I would appreciate any comments or feedback you could offer.

February 22, 2006

Sourceforge and subversion

I logged into SourceForge.net today and noticed that a Subversion link was now available when I went to the Administration page. I'm not sure when this feature became available or how long it took me to actually notice it but I think it is great news that SourceForge now provides it.

Look for Waffle's code base to be moved to Subversion shortly.

February 14, 2006

FreeMarker support in Waffle

I recently added FreeMarker support as another option for creating Views in Waffle. FreeMarker is very similar to Velocity but seems to be more powerful. One of the nice features of FreeMarker is that it will point out the errors in your scripts. Velocity basically ignores any problems you may have, while FreeMarker displays an error message directly in your html that pin-points (line and column number) where the problems is located. Additionally FreeMarker actually allows you to reference JSP tag libraries within your FreeMarker scripts. That should allows for some nice flexibility. Take a look at the FreeMarker Servlet Documentation for further details. And take look at Waffle to see how easy it is to create web frameworks when you don't have to learn a proprietary XML syntax or new UI language.

Next task is to document how to create Waffle application with JavaServer Pages (JSP).

January 26, 2006

The Glacial Methodology

The Waterfall Methodology is making a comeback in a big way. Hurry and register when you can ...


January 12, 2006

Mmmm Waffles...

It's been a while since I posted a blog, but I have been busy working on a new open source project. A new web framework for use in java/j2ee web applications.

Yes, I know there are already a plethora of java web frameworks, but Waffle (which is the name of the web framework) is different. Honest.

I wanted to work with a web framework that supports POJO based Actions, Dependency Injection, and it has no dependency on XML configuration files. Applications built on Waffle will be easier to develop and test with than other java web frameworks. Plus, it's buzz word compliant already fitting nicely with AJAX. :-)

Please have a look at the documentation and send me feedback on any suggestion you may have for improving the documentation or the framework itself.