I have the following 3 classes
Book
Product
SpecialOptions
There are many Books, and there are many Products per Book. Likewise in a Product there are many SpecialOptions. There are other properties of each of these three classes so each class has the following interface
Public Interface IBook
Private ProductList() as collection (of Products)
Private Somethingelse() as String
End Interface
Public Interface IProduct
Private SpecialOptionsList() as collection (of SpecialOptions)
Private Somethingelse() as String
End Interface
Public Interface ISpecialOptions
Private SpecialOptionsProperty() as String
End Interface
I want to create a collection of Books, which has each of the products under it, and under each of those Products I have want the associated SpecialOptions, when I pull the data out of a database. I can't decide which will be the best way to do this.
I have two methods. Either I go from the top down or from the bottom up. Meaning, I start with a book and then fill out the product information and then for each of those products fill out the detail information. OR I can get the details first, and then add them to the appropriate product and then do it again for products to books. Neither of these is very appealing.
Also, and because I suggested it to myself when proofreading, this is the structure that I need to capture the actual relationship, so reframing the problem with different structure is not going to work.