Name that refactoring: 2 - Version 2 44

Posted by Brett Schuchert Wed, 16 Dec 2009 08:14:00 GMT

A few updates applied to the second name that refactoring. Note that I’m using a star to represent a problem dependency. It is the “star” of the refactoring. I’m looking for a better image. I could go with a database icon, but the principle is more general than that. The cloud was confusing. So if you have an idea, please let me know what it is!

Again, thanks for taking a look and giving me the feedback.

Step 0: Problematic Dependency

Step 1: Capture dependency in a single class

Step 2: Raise the abstraction to a domain-level interface

Step 3: Introduce test doubles as needed

Name that refactoring: 1 - Version 2 44

Posted by Brett Schuchert Wed, 16 Dec 2009 07:43:00 GMT

Here is an update to the first name that refactoring based on feedback. How about this?

Step 0: Method with embedded dependency

Step 1:Extract method to move dependency to another method

Step 2: Subclass and override method with new code that does not have original dependency

So what do you think? Better or worse?

What about using the star in other image? In general, the star could represent the dependency we’re trying to get rid of.

Name that refactoring: 2 75

Posted by Brett Schuchert Mon, 14 Dec 2009 04:51:00 GMT

Ok, so I’m getting good feedback on the first picture. Now for a series of pictures.

How do you interpret this series?

Step 0

Step 1

Step 2

Step 3

Name that refactoring: 1 67

Posted by Brett Schuchert Mon, 14 Dec 2009 01:35:00 GMT

I’m working on writing up a few handouts I can use in a TDD class (and a few other places). There are a few drawings I keep doing and I’m trying to replicate them so I can refer to something.

Problem is, with many such drawings, the observation of the creation is as important as the end product. I’d like your feedback/recommendations (or links to better pictures). I’m curious about at least two things.
  • What does this picture suggest to you or what can you draw from it, if anything?
  • Do you think this would be better served as a series of pictures showing the build-up?

Thanks for your feedback.