Chrissirhc
Programmer
Take these situations what is best? And why?
1) Have a large class with all the methods in it that act as utility methods to the class. What I mean is that I have many data structures in this one class and I need to do things with them to create more so the methods in the class use these data structures.
2) Or is it better to have a class with static methods that take these data structures and return other data structures essentially having the same effect as option 1.
3) Or is it better to have these methods as classes which take data structures in the constructor and then return other data structures.
This is a kind of OO question and be grateful for any responses especially in OO rightness(if there is such a thing ) and especially with respect with efficieny. I have a feeling that having all the methods in one class is more efficient ( something to do with memmory)
Cheers.
Chris
1) Have a large class with all the methods in it that act as utility methods to the class. What I mean is that I have many data structures in this one class and I need to do things with them to create more so the methods in the class use these data structures.
2) Or is it better to have a class with static methods that take these data structures and return other data structures essentially having the same effect as option 1.
3) Or is it better to have these methods as classes which take data structures in the constructor and then return other data structures.
This is a kind of OO question and be grateful for any responses especially in OO rightness(if there is such a thing ) and especially with respect with efficieny. I have a feeling that having all the methods in one class is more efficient ( something to do with memmory)
Cheers.
Chris