karldmoore development

A development oriented blog, containing anything I've been working on, reading or thinking about.

Archive for August, 2008

Haven’t We Reinvented The Wheel Enough Times Already?

Posted by karldmoore on August 29, 2008

Reinventing the wheel and the Not-Invented-Here Syndrome have been widely documented in the software industry. Some companies write literally everything from scratch; defect tracking software, time reporting software, wiki software, you name it they write it! Others want complete control over all their application libraries so if a framework isn’t approved, instead, they’ll just write their own.

I caught up with a developer earlier this year who was telling me some of the stories he’d heard over the last couple of years. This article is dedicated to one of the stories he told me.

Developer X had just started a new job, and his first project was based around writing a criteria style query language to gather data from a legacy database (hosted on MySQL). After programmatically building a criteria object, the code had to generate simple SQL and also more complex queries including like, or, and, in, not, pretty much the full range of query options. There were a few projects that came to mind, but the first was the Hibernate criteria query API. It seemed like a good fit, and this is exactly what the developer had thought as well. He didn’t realise however that he’d joined a team which suffered from the Not-Invented-Here Syndrome.
Read the rest of this entry »

Posted in Development, Opinion | Tagged: , , | 7 Comments »

Beware, The Developer Who Isn’t Interested In Development!

Posted by karldmoore on August 23, 2008

When I first started my software engineering degree, there were plenty of people I met who simply didn’t want to be there. After a few months they’d had enough and moved onto something else, and after a couple of years the classes had halved in size. I’ve actually met a few people in the industry who behave like they don’t want to be here either, but I was hoping they were in the minority. After speaking to a former colleague however, I’ve found that the problem might be much worse than I had thought. The contradiction of the developer who isn’t interested in development.

Let me just start by saying, if you’ve got this far you really aren’t one of the people I’m talking about! Hopefully you’ll see this as a good thing :-).
Read the rest of this entry »

Posted in Development, Opinion | Tagged: , , , , , , | 25 Comments »

Spring JdbcTemplate: The Phantom Performance Problem

Posted by karldmoore on August 19, 2008

Over the past few years there have been numerous posts on Spring Forum regarding the performance of JdbcTemplate. The majority of these are complaining about poor performance of JdbcTemplate in comparison to pure Jdbc. I thought this topic had been done to death already, but a friend of mine told me his developers were having performance problems with JdbcTemplate as recently as last week. They had switched back to Jdbc after some performance comparisons had proven JdbcTemplate was significantly slower.

So what makes JdbcTemplate so much slower than pure Jdbc? In a word…….. nothing. JdbcTemplate does a great job of removing the try/catch/finally/try/catch code we used to write with Jdbc, but under the covers it’s just doing the same old stuff we used to do. It’s getting hold of a connection, executing a statement, possibly mapping a result set to an object, converting any exceptions for us and releasing the connection. That’s pretty much it, it’s a thin wrapper around Jdbc that makes it usable in the real world.

So why do people report performance problems with JdbcTemplate? I took the opportunity to review the comparison that had reported such terrible performance compared to Jdbc. After a couple of minutes reviewing the comparison it was quite obvious it was fatally flawed, not only was it configured differently, it wasn’t testing the same thing. Looking at the comparisons that have been posted in the past on Spring Forum, they typically suffer from the same problems. The most common is they generally don’t perform a fair test. Lets look at the typical problems the comparisons face before seeing the comparison results once the problems were fixed.
Read the rest of this entry »

Posted in Spring | Tagged: , , , , | 7 Comments »

Structured Approaches To Improving Code Quality

Posted by karldmoore on August 17, 2008

Over the past few years, I’ve worked on numerous projects that have grown very quickly but have lacked a structured approach to development. The code is grown somewhat organically, being used in ways never imagined and bent into shapes it was never supposed to make. In the very worst cases, it ended up with Spaghetti Code that is self-obfuscating and unintelligible (even to the original author).

To help prevent this situation, teams need to embrace processes to help introduce structure and discipline to software development. This can be daunting to some teams at first, but it’s a far more productive and appealing than a team that is constantly under-pressure with various fire-fighting activities.

Kent Beck has said previously that he is not a great programmer but just a pretty good programmer with great habits. I’m a firm believer in that statement, and I think that any team that doesn’t try to develop those habits is starting from a weakened position. I’ve worked on both projects that embraced change and tried to improve their development process and also those that didn’t. I would sooner work on the former type of project every time.

With that in mind, there are very simple changes you can make to a project to help foster better habits. None of these techniques is new or groundbreaking (at least anymore), but I am still amazed at the number of projects that still don’t embrace them. There is plenty of information on these techniques out there, so there is no excuse if you want to do some more reading.
Read the rest of this entry »

Posted in Development, Opinion, Refactoring, Testing | Tagged: , , , , , , , , , , , , , , | 11 Comments »