D
Diego
I have a class with 20+ class variables, mostly String and Date types.
The constructor of this class receives a String which is raw text that
has to be parsed. The parsing will extract data to populate the class
variables.
It does not seem right to me to perform this operation in the
constructor. I looked into the GoF creational design patterns but can't
seem to be able to find the appropriate solution for this problem.
Neither Factory Method nor Abstract Factory look like the right thing to
do (at least to me).
Can anybody suggest a good alternative to doing the parsing in the
constructor?
Thanks,
Diego
The constructor of this class receives a String which is raw text that
has to be parsed. The parsing will extract data to populate the class
variables.
It does not seem right to me to perform this operation in the
constructor. I looked into the GoF creational design patterns but can't
seem to be able to find the appropriate solution for this problem.
Neither Factory Method nor Abstract Factory look like the right thing to
do (at least to me).
Can anybody suggest a good alternative to doing the parsing in the
constructor?
Thanks,
Diego