lundi 1 juillet 2019

What's the purpose of making the class which instantiates all other classes and subsystems

After looking at many open source projects i have noticed that many of them use the same idea for initialization and deinitialization of the whole system. Many of them have one specific class (likely it's a singletone) which loads resources, instantiates all other classes, subsystems, connects them to each other and prepares the objects structure which is used during run-time. Why not to do that in main()? Which idea is behind this approach, is that some high-level programming pattern which has a lot of advantages?

Aucun commentaire:

Enregistrer un commentaire