Pages:  1 2 3 4 5
Lots and lots of tests
  Created - 2013/09/23 21:58:32+0000

When I write code I don't use test driven development. I do write tests. Unit tests and integration tests and tests where I don't bother to make a distinction. I do write plenty of them. This gives be two things: Something to run my code The ability to refactor and know if I changed something I shouldn't have When I write code the first thing to run it are my tests. I don't worry about a test contract, I'm happy to rewrite the code and the test at this point. The tests just tell me w... read more

Why you should love checked exceptions
  Created - 2013/07/06 14:18:25+0000

This week at work I encountered a NullPointerException caused by returning a null value. The return value was not tested and when it was used it threw a NullPointerException. This of course had to happen in patch of bad exception handling. First the bad exception handling. This is what I had to work around first. A method was throwing a couple of checked exceptions with no shared super class before Exception. Some programmer decided to say that it threw Exceptions and the calling method happily caught e... read more

How work cascades
  Created - 2013/06/23 10:08:32+0000

It started when I noticed that the detached signatures of the RDF documents were not correctly linked. There was an extra '/' at the start of the path. I recognized this problem immediately as a mistake in the XML file. The host is described in the XML file as an entity ending with a '/'. The path following on from this also included a '/' so I thought I would taken 10 minutes to fix and release it. Easy, releasing it would be the hardest part. I then noticed that there was dupli... read more

Deflate and IE
  Created - 2013/03/29 21:00:36+0000

When I recently added support for the deflate content encoding I broke my website in IE. The static content became unreadable in IE. It turns out that IE only accepts raw deflate data without a wrapper. This means that within the code for compression I need to match on the User-Agent header. Any IE browser requesting deflate receives the raw deflate encoding and any other browser requesting deflate receives the wrapped deflate encoding. The deflate wrapper is defined in RFC 1950 and the deflate com... read more

AuDAO and building my website
  Created - 2013/03/16 12:01:30+0000

I use a tool called AuDAO to generate the Data Access Objects, Data Transfer Object and SQL. These are generated from an XML description of the tables. I found it very useful and it is a convenient way to access a database from Java. That said it isn't suited for high volume websites, I was unable to find out any information on optimizing performance. The data objects map directly onto the tables generated by the SQL. Much of the functionality provided by databases and SQL is made unavailable because of ... read more