This post originated from an RSS feed registered with Agile Buzz
by Keith Ray.
Original Post: Domain Driven Design Temperature
Feed Title: MemoRanda
Feed URL: http://homepage.mac.com/1/homepage404ErrorPage.html
Feed Description: Keith Ray's notes to be remembered on agile software development, project management, oo programming, and other topics.
That's kind of lame. Eric Evan's advice from Domain Driven Design is that classes that end of "-er" or "-or" should be avoided. Here's a test [in Java] that may better reflect the domain.
The trouble with that approach is that Fahrenheit and Celsius are two different types for the same kind of measurement. Maybe these tests (and the design they would force) would be better:
Perhaps if NASA and Lockheed Martin had used Domain Driven Design when writing the software for the Mars Climate Orbiter, the 125 Million Dollar probe would not have been lost because NASA used metric units for distance and speed while Lockheed Martin used traditional English units. They didn't have to write conversion code, just class names (or "typedefs" or equivalent if using C or other non-OO programming language) that indicate the units being used. Someone expecting different units would be clued-in by the class or type names.