Yesterday I attended a NLJug meeting at Oracle at De Meern on JavaFX, called ‘JavaFX 2.0 EA‘. The meeting was presented by Roger Brinkley, who’s a called ‘Community leader’, of Mobile and Embedded. That he was formally part of Sun wasn’t hard to see based on his clothing and style.
Roger gave an overview of the new JavaFX 2.0, the road-map and the planned features (more…)
Implementing a Java SPI isn’t a particularly 2011 experience1. Creating a correctly-named text file in META-INF/services, making sure it is correctly packaged and remembering to keep it up to date when you refactor is sufficiently annoying and error-prone that there are at least a couple of utils that aim to make this easier.
At XebiaLabs, however, we’re not just the implementors of our plugin SPI. We also write the deployment engine that consumes these plugins. And unfortunately, there isn’t much out there to help you read, load and verify services. Hence MultiSPI.
(more…)
Tags: dependency injection, Java, spi
Filed under Java, Tools | No Comments »
Before you start wondering, ‘deconfluencing’ is not a word you can lookup in Merriam Webster. Perhaps it should be. It certainly is something I needed, and eventually ended up creating myself.
Tags: confluence, Java, proxy
Filed under Java | No Comments »
Trying to produce bad quality code is quite hard when you are using Test Driven Development (TDD), even when you are doing it wrong on purpose.
Recently Iwein and me were preparing some labs for a developer training and the plan was to create some really bad quality Java code as a starting point. Students would then be asked to clean it up and add some new features, all this of course with the intent to show the effect of bad code quality on your ability to quickly add new features. This was going to be a piece of cake!
After some brainstorming for interesting standalone programming challenges, we came up with the idea of writing a JSON to XML converter. It should be able to take any valid JSON string and convert it into a simple XML representation. Out of habit and without really considering the option of skipping this step, we started with a simple failing test. Here it is:
@Test
public void shouldConvertTopLevelEmptyArray() {
assertThat(converter.convert("[]"), is("<array></array>"));
}
Simple, right? To implement our converter we decided to use the well known “red, green, as little refactoring as possible” anti-pattern, which we expected to result in lots of copy-paste duplication, very long methods, and the other typical code smells we all know and loath. Our first implementation approach was to go for some all-time favorite candidates for producing bad code: string manipulation and regular expressions. As Jamie Zawinski famously said: “When some people have a problem, they think: ‘I know, I’ll use regular expressions’. Then they have two problems.” We had created a sure thing recipe for disaster. It was going to be all downhill from here, or so we thought.
Tags: code quality, json, TDD, XML
Filed under Fun, General, Java, Testing | 3 Comments »
I live in Utrecht, a city where it seems the municipality tries to annoy car drivers as much as possible. Public transport isn’t an option, even despite the traffic jams it’s slower, less reliable and don’t get me started on the attitude of bus drivers. When you want to travel from one place in Utrecht to another it’s often a good idea to find the nearest highway, it might be much longer, but often much quicker. Instead of complaining (which will stop now
) there might be a solution. I have a theory that a trip is much faster when you avoid traffic lights and use the highway as much as possible. To prove that theory, test my new (Android 2.2) phone, fresh up my Scala knowledge and have a cool pet project I started logging my trips.
In this article I will show you how to collect the data, parse and convert it to a usable format and show it on a map. This is just a first prototype and proving my theory will probably take a lot more time which I don’t have because I’m in traffic jams all the time
.
If you don’t like all the technical mumbo jumbo, just scroll to the maps, they’re cool to look at.
(more…)
Tags: geotools, GIS, openstreetmap, qgis, Scala
Filed under Java | 3 Comments »
Last friday we had a techrally at Xebia. We could pick our subject: MongoDB or Websockets or Canvas. I teamed up with Albert. There also was another websockets team consisting of Mischa, Ron and Frank.
We decided to use Jetty for websockets. No particual reason to pick Jetty, we both heard it did something with websockets and in the end it was an easier solution than the other team picked (jWebSocket).
Since we only had a few hours we were in quite a hurry, but in the end it was so simple we had time to write a blog, listen to Dan North and Albert even redid everthing and more in Python. (more…)
Tags: Javascript, jetty, techrally, websockets
Filed under Java, Web 2.0 | 7 Comments »
At Xebia, we show a lot of interest in the developing NoSQL community and all the great software and solutions that result from it. Big data analysis and heavy traffic web sites and applications are here to stay and we need solutions capable of dealing with those. The commodity stack of some flavor of relational database with a Java app server on top and the stateful model of server side sessions just doesn’t cut it in some cases. As data volume and traffic grow, these cases will present themselves increasingly often. In our App Incubator program we see a lot of interest in non relational databases and stateless server side setups with more logic on the client side (cleverly coined: NoJSP). Also, at clients the problem of ever growing data sets and the lack of options to do proper analysis with existing tools and databases starts to arise. One of these clients is the RIPE NCC. The story is roughly this: about 80GB of data comes in per day and there is ten years of historical data of the same kind and volume; we need to do queries against this and get sub-second answers. We solve this with the use of Hadoop en HBase.
(more…)
Tags: hadoop, HBase, NoSQL
Filed under Architecture, Java, NoSQL | 2 Comments »
Contrary to what you might have expected because of the title, this is not an introduction to the marvelous UNIX hexdump tool. If that’s what you were searching for, then you better pull up the man page first, because I’m not going to spend a word it. This article is about something better…
Filed under Java, Tools | 2 Comments »
Summary
In the first part of this review (the JavaEE6 back-end) I created a small application which is a JSON REST service to be used as back-end for a JavaFX front-end.
This second part of my review covers a small review of JavaFX, to see if it meats my requirements as front-end for my personal finance application (see previous post).
My conclusion for now is that JavaFX is an interesting new technology, I think it can be used for small applications or forms (think about internet adds). But for serious applications it is not ready yet.
I am really missing Datagrids, the way you have to deal with Session cookies for the Rest service is far to low level. I hope someone can point me to a place where I can find better solutions for those problems (if there are).
Filed under Java | 5 Comments »