Program design:
- Class A, which implements lower level data handling
- Classes B-E, which provide a higher level interface to A to perform various functions
- Class F, which is a UI object that interacts with B-E according to user input
- Classes B-E, which provide a higher level interface to A to perform various functions
There can only be one instantiation of A at any given time, to avoid race conditions, data corruption, etc.
What is the best way to provide a copy of A to B-E? Currently F instantiates A and holds onto it for the life of the program, passing it to B-E when creating them. Alternately I could create a globally available module with a shared copy of A that everything uses. Another alternative is to make B-E subclasses of A, but that violates the constraint of only one A (since each subclass would be their own data handler, so to speak).
Language is Python 3, FWIW.