Replace Data Value With Object

last modified: May 9, 2003

In general, the idea is to change from operating on a bit of data yourself to asking the the data to perform the operation.

It seems to me that strings are the smelliest of all primitive types. There are _always_ rules about what are valid values for string variables, what the contents mean, where they come from, what you do with them, etc.

In the YahooGroupsRefactoring PaulMichali posted a class with this member:

string startDate

which immediately triggers an OlfactoryResponse. The first change is:

Date start

chances are if there's a start, there's an end, so

DateRange range;

and the range probably has meaning of some kind, so you might perform ReplaceDataValueWithObject on the DateRange now.

PhlIp called this PrematureSerialization: "It's the root of all evil leftover from the other roots of evilitude."

-- JayBazuzi


Loading...