Maarten Winkels

Play!: Body parsing with Jerkson

Maarten Winkels

While playing around with the Play! framework today, I stumbled upon the somewhat clunky JSON integration for reading the body of an HTTP request. The recommended approach of using type safe JSON and browsing the tree while creating your custom object or using a Format seems quite cumbersome for most standard situations that the standard libraries Jerkson and Jackson (included in Play!) handle gracefully. In this blog I will describe an approach that uses a custom BodyParser to come to a simpler solution.
 Read more

Apply TDD to Hadoop jobs with Scoobi

Maarten Winkels

Map Reduce is a programming model for writing algorithms that process large quantities of data in a (relatively) short time. The building blocks for the programs are very simple map and reduce functions. Writing programs that do more and more complex tasks to data based on those simple functions becomes harder and harder and thus requires more thorough testing in early stages. This blog attempts to outline a simple method for testing the algorithm of a Map-Reduce program based on scoobi.

 Read more

Agile says: Nothing will ever be perfect

Maarten Winkels

Wouldn’t it be sweet if your whole life were perfect? Your wife would fulfill your every wish. Your children would be perfect examples of responsible happy people growing up. At work your colleagues are the nicest people and working with them is always fun. Your team would feel responsible for every action they (proactively) take and the software systems you produce and maintain are flawless and run like well oiled machines?…

You need to wake up! Nothing will ever be perfect and Agile knows it!
 Read more

Master-detail implementation for RESTful services with JQuery

Maarten Winkels

In two previous posts, we have seen how to develop RESTful application with JBoss AS 7. At the end of the second blog we used a generic REST client tool to execute some RESTful web services. Of course we would rather build a custom UI application as client for our services, so that a user can easily access and manipulate the data. In this blog we build a REST client that is based on the master-detail principle.
 Read more

Developing a JPA application on JBoss AS 7

Maarten Winkels

In my previous post we setup a Maven/Eclipse project for developing RESTful web applications on JBoss AS 7. A RESTful web service that is not using a database is some what of an oddity. Therefor in this blog we’ll extend the project with JPA.

 Read more

Developing RESTful applications on JBoss AS 7

Maarten Winkels

JBoss AS 7 CR1 has been released recently. On the previous release it was pretty easy to develop RESTful applications with the build in JAX-RS support based on RESTeasy. In this blog I’ll look at how well the new version of JBoss keeps up with the rest of the field.

 Read more

Writing and testing data structures and algorithms in JavaScript

Maarten Winkels

Tonight in one of our knowledge exchange sessions, one of my colleagues challenged us to writing a TagCloud in JavaScript. He had prepared a nice setup with a server producing twitter hashtags over a WebSocket to the browser and using Processing.js to produce a graphical representation of the tags zooming by on twitter. Since he had already done all the heavy lifting in integrating all these fancy new frameworks, what was left to do, you might ask. Well, we still needed to implement the algorithm to count the number of tags on the continuous stream, sorting this list on the bases of the counts and making sure the system wouldn’t run out of memory by removing less used tags in some smart way. His point to all of this was, that although JavaScript is being prophesized in some circles as the new-old-new language of the future, writing and testing a non-trivial algorithm in it is a big challenge.
 Read more

Posting complex forms with RESTEasy – Part 2

Maarten Winkels

As promised in a previous blog, I’ll devote this blog to how to extend the RESTEasy framework with support for mapping form fields on object-graphs with complex associations, like lists and maps.

These extensions have been reported to RESTEasy as two issues with patches. If you like these features, please vote for these issues.
 Read more

How to use annotations for configuration

Maarten Winkels

In the java world we have been using and getting used to annotations since Java 1.5. Although there were some critical voices at first, I think most of us have come around and are using annotations now quite extensively. In my experience annotations are mostly used on POJO domain classes to configure frameworks like Hibernate, Spring and Seam and many other frameworks to be able to handle the custom objects correctly.

There are as many different approaches to this as there are implementations. In this blog I try to identify a few of the better approaches and a few of the poorer ones. The blog is not so much meant as a critique on the frameworks that the examples are taken from, but more as a guide to designing your own annotations whenever you might be faced with that task.
 Read more

Posting complex forms with RESTEasy – Part 1

Maarten Winkels

RESTEasy is a Framework for building RESTful applications in Java. In this blog I will show how to easily build RESTful webservices that accept data from an HTML Form. We will also explore the possibilities to extend RESTEasy to handle more complex cases.
 Read more