G
Guest
I need to write a program validate a text file in CSV format. So I will have a
class DataType
and a lot of of derived class for various type, e.g. IntType, StringType,
FloatType, MoneyType, ... etc.
For each column of a type, it may accept null/empty value. or not. It may
have various max length for StringType, IntType,... etc.
And for each column, it may have certain range checking, like some column of
IntType can only between 1 to 25. Some StringType column can only be certain
values.....
Which design patter is best for this? A dictionary with decorate design
pattern? sound too heavy....
class DataType
and a lot of of derived class for various type, e.g. IntType, StringType,
FloatType, MoneyType, ... etc.
For each column of a type, it may accept null/empty value. or not. It may
have various max length for StringType, IntType,... etc.
And for each column, it may have certain range checking, like some column of
IntType can only between 1 to 25. Some StringType column can only be certain
values.....
Which design patter is best for this? A dictionary with decorate design
pattern? sound too heavy....