Hi all,
I have a (design of) an application to basically work like this:
class Main, class BusinessLogic, class UserInterface
BusinessLogic and UserInterface are designed to be library-like - not on-goingly developed but used by a developer in say, class Main.
The constructor of BusinessLogic also instantiates UserInterface, which will display a text-based menu and take terminal input. Based upon that input, it will execute the relevant functionality by invoking the relevant method of its respective BusinessLogic object.
However, this is a circular reference, and there's no apparent way for UserInterface to call its respective BusinessLogic object (without the BusinessLogic object identifier hardcoded, but that's even worse practice!).
This does seem a logical design to me, but hard to implement in programming terms.
One alternative I considered is simply having UI return the input data to BusinessLogic's constructor, but I don't want BusinessLogic to handle input analysis, UI seems the sensible place for it.
Any ideas?