November 18, 2002

Be explicit with your data

Design Principles and Code Ownership - Part II of an interview with Martin Fowler. One counter-intuitive item he points out (under “Being Explicit”) is that using a dictionary (a.k.a., Map, hash, DynaActionForm, etc.), while more flexible, is not as explicit as using a class. I couldn’t agree more, and this is one of the things I do with Struts by explicitly coding ActionForms rather than using the declarative version. It’s also why I dislike the Data Transfer HashMap pattern. (Mike also mentions the “Unit testing makes me strong” part of the interview.)

Next: Delayed gratification
Previous: Getting good