Simpleton – An object that has one purpose.
I applied this thinking to a recent story where I had to implement a security model in our public service api. The model needed to validate http requests against username and password and a digital signature.
Following the simpleton approach it was possible to drive out the following objects:
BasicRequest – Extract http BASIC credentials from an http request.
SignedRequest – Extract custom http headers from an http request.
BasicRequestValidator – Validate request based upon the provided basic header details.
SignedRequestValidator – Validates request based upon the provided digital signature.
By allowing objects to have only one purpose it was remarkably easy to tdd each object in turn and integration into the service tier was simply a case of newing up the Request objects and passing them to the validators.
So next time you're thinking about the objects you need in your system, become a simpleton, it might be pretty smart :-)