i need to write a program with is fully oop.(Domain, Repository, Controller, UI(TUI)) But i have some issues with creating the link between my menu > controller > repo functions. How should i create the constructor of the controller? i have an example but i dont get much from it, could anyone explain me this constructor?
class ConsoleUI {
public:
ConsoleUI(MusicStore* store) : musicStore(store) {}
void run();
private:
MusicStore* musicStore;
void showMenu();
int readOption();
.
.
.
void showMenu();
int readOption();
void printBestSoldAlbums();
};
This class has constructor with one argument – a pointer to
MusicStoreobject.Only thing it does – sets
musicStoremember to passed argument.