i want to create an app in which i have these two classes, MainApp and Model (in reality more, but this is the base and the core of the problem). MainApp is also the starting class. I want to apply dependency inversion so mainApp doesn't have to be rebuild each time Model changes (Well, mainly because its good practice). I can't do this:
MainApp - - - > IModel
^
|
|
Model
because i'd have to create Model in MainApp anyway because it's the start of my app, it would be redundant.
I was thinking about shifting the contents of MainApp to another class and use MainApp just as factory for MainAppContents and Model, like this:
MainApp -------------> Model
| |
| |
v v
MainAppContents - - - > IModel
Is this the correct approach and does this mean that any start of a well designed app is a factory?