Archive for November, 2007

Wicket migration: from 1.2.6 to 1.3.0-beta4

November 12, 2007

Since 1.3.0 is knocking, we decided to upgrade what we currently have (which is a small module from the functional web app) to wicket 1.3.0. The guide to migrating or the things that are different in 1.3 vs. 1.2.6 are here .

Here is the list of things I ran into when migrating

Organize Imports

All of the packages had to be re-imported because as of 1.3.0 wicket is under Apache license and instead of wicket.* it is org.apache.wicket.* That is not a big deal if you use an IDE like Eclipse. Or any other text editor that has a powerful regexp facility or simply organize imports menu item.

1.3 uses Filter, Not Servlet

If your environment supports filters, then just replace the servlet and servlet-mapping with filter and filter-mapping

http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-FilterinsteadofaServlet

Converters

If you were using custom converted in your app and you were extending SimpleConverterAdaptor, now there is a different component you have to extend: AbstractConverter.

Submit Link

If you were using SubmitLink for button functionality in 1.2.6 put SubmitLink inside a Form. Because SubmitLink doesn’t extend Button anymore, it doesn’t by default turn into a a submit. So if you have it outside than put a form around it (it is a good idea anyways – why would you have a submit without a form? What are you submitting?)

ISessionFactory is gone

Instead of creating an inner class inside Application to implement a SessionFactory just to create a custom Session there is a method called newSession (Application, Request) which you can over-ride to create one.

Wicket-Spring Jar

Was split into 2 wicket-ioc and wicket-spring to provide common functionality for integrating Guice.

CodeOff Result: Wicket wins

November 8, 2007

After a prolong trial Wicket wins! We will be using it to port our application. However, we will still be using Spring MVC for other applications. So that will give me a chance to evaluate them further.

Java Traffic simulation

November 3, 2007

Some people asked me to post the code for java trafic sumulation. So here it is.

What is it?

“Traffic simulations attempts to imitate the situation encountered when traveling on highway at peak times. It attempts to answer the question whether or not having meters control the traffic flow has any effect on the average commute time.

To answer this question we approximated some of the variables:

The speed is adjusted based on the number of cars on the highway. We didn’t take into account other factors such as driving conditions or time of day.” Want to know more? Here it is : Trafic Simulation Doc.