Say I have two separate classes: A and B.
I also have a C repository class that loads some information from a text file. For instance. It has methods loadLines() , addLine() , deleteLine() .
Ignoring data binding, how can I get A and B to work in the same class C. Is this possible?
For example, at the moment in class A and B formload I have:
var classC = new C();
This causes re-execution. It would be much better if I could have one copy of class c to work with A or B.
edit: so using singleton when the class constructor is executed? - which class first creates it? and it happens only once when I accept it?
edit1: Using the singleton template implies that you should have only one of them in your design decision? could i have a few?
source share