I am working on a program that has several frontends. The main application has a GUI that allows a lot of manual user interaction. The second one is more like a script that just runs a default work flow.
At some point questions to the user may appear. These are most often related to ambiguous input data, where the user must decide on one of the possibilities. The ambiguities often originate from the data format of an external program, so just getting rid of them is not an option.
The easiest way to get the user input would be to just open a message box with the available options. I would however prefer to have several classes handling that. One that creates a GUI dialog, one that asks for the options on CLI and one that just answers from prerecorded decisions (e.g. for testing).
The two possibilities I see are having a singleton that stores an object of the desired class or passing it through the whole call hierarchy for every tiny class that may raise a question.
Are there any design patterns or best practices on how to solve this issue? It seems like a standard problem to me.