Note: WinForms C# Early Learning Level!
I would like some assistance with the best way to implement a situation in a C# object environment. I cannot post code because it doesn't exist yet, however I can give you an alternative real-life comparison.
In simple terms (because thats how I work) I have a Book class. I have a collection (<List>
) of these Book classes.
Within each Book class I have a collection (<List>
) of Chapter classes. The book Class and the Chapter class are based on completely different abstract classes. These are defined in a separate business layer and data is loaded from a data source layer. Bear in mind that there are many books and many chapters.
From my GUI layer I can retrieve a book and it’s underlying attributes based on the collection index/key. I can also get all the chapters within the book via the Book class.
What I need to do is to be able to get any Chapter class from any Book without having to go via the Book class. What’s the best way to make this happen?
Thanks guys and gals