E
eran
Hi all,
There's a huge class in our app that I'd like to fragment a bit. I'd
like to move some of the code to a new class. The new class will have
to get a large number of parameters in order to do its job. As I see
it, there are 3 ways of setting that bunch of params:
- Pass them all as argument to one function
- Set each one of them
- Use a params struct
What bothers me is this: I'd really like to minimize the chance that
the caller will miss setting one of the params. The first way will
avoid that, but passing a large number of params to a function is
ugly. There might not be a better solution, but in case I'm missing
something, I'd like to know if there's any elegant way to do this.
I know that asking a question like this, people might advise me to
redesign my app. Well, as Raymond Chen once said about the Windows
batch "language" - this class was not designed, it has evolved... I've
neither the time nor the will to rewrite the whole thing; I'm just
trying to make it a bit more workable.
TIA!
There's a huge class in our app that I'd like to fragment a bit. I'd
like to move some of the code to a new class. The new class will have
to get a large number of parameters in order to do its job. As I see
it, there are 3 ways of setting that bunch of params:
- Pass them all as argument to one function
- Set each one of them
- Use a params struct
What bothers me is this: I'd really like to minimize the chance that
the caller will miss setting one of the params. The first way will
avoid that, but passing a large number of params to a function is
ugly. There might not be a better solution, but in case I'm missing
something, I'd like to know if there's any elegant way to do this.
I know that asking a question like this, people might advise me to
redesign my app. Well, as Raymond Chen once said about the Windows
batch "language" - this class was not designed, it has evolved... I've
neither the time nor the will to rewrite the whole thing; I'm just
trying to make it a bit more workable.
TIA!