Tuesday, November 30, 2010

Wicket Katas

A code kata is an exercise in programming which helps hone your skills in through practice and repetition.  I completed 11 different Wicket katas by making small changes to existing Wicket systems.  These katas are thoroughly defined at 31.WicketKatas.

Example 01:
Kata 1A:  The task was to display a timestamp one week in the future.  This took about 20 minutes to complete.  Instead of using a Date class, I used to a Calendar class because it supported the addition of days to the current time.

Kata 1B:  The task was to add a button that refreshed the timestamp when clicked.  This took about 20 minutes to complete.  I added a form that refreshed the page and consequently the time displayed.

Kata 1C:  The task was to have Wicket run in "Deployment" instead of "Production" mode.  This took about 2 minutes to complete.  I simply looked up the appropriate method and added its 3 lines of code into ExampleApplication class.

Kata 1A and 1B
Example 02:
Kata 2A:  The task was to add a link to a page that embedded a locally saved image.  This took about 1 hour to complete.  The difficulty was in figuring out the correct path to the image.

Kata 2B:  The task was to add a button that made all text bold, italic, or normal in a linear order.  This task was the most difficult and took about 5 hours to complete.  First, all text and links in the html file were made into components so that they could be modified by Wicket.  Then depending on the current state, the text was changed to reflect the appropriate behavior such as adding <b> and <\b> to make it bold.  Finally, the method setEscapeModelStrings was set to false so that Wicket did not escape '<' and '>' characters.

Kata 2B
Example 03:
Kata 3A:  The task was to add a link to a page that embedded a locally saved image.  This took about 10 minutes to complete.  It was very similar to 2A with the exception that I had to create a separate package for the image page.

Kata 3A
Example 04:
Kata 4A:  The task was to add a new cheese called "Velveeta" with a cost of $0.25/lb.  This took about 10 minutes to complete.  The most time-consuming part was finding the class file that contained the collection of cheeses.

Kata 4B:  The task was to add an additional "country" field to the checkout page.  This took about 15 minutes to complete.  The most difficult part was tracking down the changes had to be made in different class and html files.

Kata 4A
Example 06:
Kata 6A:  The task was to remove the blue columns on the website.  This took about 15 minutes to complete. I simply had to track down the showgrid option in the css file and delete it.

Kata 6B:  The task was to place the image underneath the form instead of to the right.  This took about 5 minutes to complete.  I did this by removing the <div> <\div> tags in the html file.

Kata 6C:  The task was to have the application run in deployment or production mode depending on the "deployment" status in a configuration file.  This took about 1.5 hours to complete.  The difficulty was in figuring out the correct path of the configuration file and testing to see that it worked.

Kata 6B
Conclusion:
These Wicket katas were very useful in transitioning to a new framework.  I learned how to add forms, buttons, images, and much more by modifying existing systems.  These exercises also reinforced how Wicket components interact with hypertext markup language.

My modifications are available for download below:

Example 01
Example 02
Example 03
Example 04
Example 06

1 comment:

  1. Secondary and validated primary sources are used to Cowboy Hats evaluate key enterprises and their production data, percentage splits, market shares, product trade breakdowns, and progress rates. The first machine Magic introduced is a prototype extrusion blow molding machine with all-electric know-how and synthetic intelligence. The new EBM Model ME-T S with AI shall be a machine that can have real time, computerized modifications to the production of bottles being produced with the machine, the corporate stated. It may have options such as the calibration being up to date routinely as soon as} the machine is assigned a task. Various different design issues must be thought-about whereas making a mould, along with the mould base and mould channels talked about above. The plastic injection mould design needs to include advanced geometries and options like undercuts.

    ReplyDelete