I'm (as new oop and c# hobbiist) would like to ask for some guidance on the following (simplified) problem:
I've made a small class (lets call it A), with 4 properties, and few methods. Also a larger class (B) with ~10props, and it should contain 12 objects of class A, and a fair amount of functions to play with the props. I have my main class M (which is a windows form), a Filereader class (F) to handle all I/O.
I made a windows event on wm_devicechange, that the usb should be read, making an object of F. Now as F reads the file, it should fill the properties of the object from class B, which was created in the class F. Now the problem is, I cannot access this object of B from my main class. The question is how to do this right?
Should I make a property of F which is type B? Is that common practice? Should I make the object of B in my main class? When making a poperty in F of type B, does it only store and pass the reference if get from M?
I would like to try to avoid useless copiing of the object and such, but this topic of oop is so overwhelming for me right now, even after a few books, I am not even sure this question makes a lot of sense. I have read this article 3 times, but I am still confused what is good practice of handling such a "problem"?
Thanks