S
Steve Brecher
In a calculation application I want to create a new class that interacts
with the user to get a problem specification. Currently the application UI
is via the console, so problem specification is a series of prompts and
responses. This series would occur only once per instance. Is there a
reason not to do this UI within the class's constructor rather than as a
separate method? E.g. (from the class's creator's point of view)
ProblemSpec spec = new ProblemSpec();
result = calculation.result(spec);
rather than
ProblemSpec spec = new ProblemSpec();
spec.GetSpecFromUser();
result = calculation.result(spec);
with the user to get a problem specification. Currently the application UI
is via the console, so problem specification is a series of prompts and
responses. This series would occur only once per instance. Is there a
reason not to do this UI within the class's constructor rather than as a
separate method? E.g. (from the class's creator's point of view)
ProblemSpec spec = new ProblemSpec();
result = calculation.result(spec);
rather than
ProblemSpec spec = new ProblemSpec();
spec.GetSpecFromUser();
result = calculation.result(spec);