2022-10-02 12:27 AM
AFAIK, destructors are meant for "deinitialization", freeing memory and such. But isn't it what tearDownScreen() in views and deactivate() in presenters do? Are the views and presenters destroyed when the application changes screen, or are they kept in memory without calling destructors?
Is it safe to treat the Model as a singleton? I mean - I made a singleton of it (by adding getInstance() method) and it works exactly as expected. I wonder why this method is not built in by default. It gets useful when I add "Execute C++ code" interaction from the designer.
BTW, why are some of the members of TouchGFX generated view and presenter classes protected and not private? It seems just natural to call them private, does it make any sense to extend the view or presenter classes? I just can't imagine such scenario. How? It would make more sense if the view or presenter class extended some other class, but how could it be a base class for anything else?