Pushing the envelope

Darren's take on Java, agile methods, cool open source stuff, interesting technologies and other random wanderings through the land of blog.
Updated: 26/01/2003; 11:51:04.
Places to go
Apache Jakarta Project
c2.com
ExtremeProgramming.org
OpenSymphony
XProgramming.com
XP Developer

People to see
Russell Beattie
Eugene Belyaev
Tony Bowden
Mike Cannon-Brookes
Jeff Duska
Paul Hammant
Scott Johnson
Brett Morgan
Rickard Öberg
James Strachan
Joe Walnes

Things to do

Subscribe to "Pushing the envelope" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


That was the day
December 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Nov   Jan



Archives
December 2002
November 2002
October 2002
September 2002
August 2002

Listening To


Valid RSS

Click here to visit the Radio UserLand website.

  04 December 2002

Introduce Interface Refactor

Dr. Cedric In the House. Cedric has a new style on his blog (very nice) and an interesting new post on using Interfaces. In it he makes two interesting assertions: never supply an interface without a factory and "new" should only appear in factories. He's going to expand on the second one later, but the idea is that the first rule avoids this type of code:
IEmployee emp = new EmployeeImpl();
Woof, that's ugly, ain't it? Check out Cedric's site for the details.

...

Now someone help me out, I'm starting to see posts about Test Driven Development (TDD) where they're talking about creating lots of interfaces. Is this true? Tell me it isn't so! I need some education on this topic...

-Russ [Russell Beattie Notebook]

Pure greenfield Test-Driven development means only doing things as the tests need them, so interfaces should only appear where they're supposed to. However, pure greenfield development is something of a rare beast. A fair proportion of my time is spent doing Test-Driven Refactoring, where I'm trying to retrofit the attitude and practice of Test-First to lumps of intransigent legacy code. Interfaces are the programmer's equivalent of a crowbar in these situations. You have to lever apart the coupling in order to fit a TestCase into the gap.


6:58:48 AM      comment []

© Copyright 2003 Darren Hobbs