I'm not sure this is the correct forum but I would like to model a library of books and I'm stuck on a key concept of OOP. The library would contain one or more book types like "fiction" or "reference". The book types would contain one or more books like "Gone With the Wind" or "VB Classes in 21 Minutes" :) Each book would contain one or more "pages". I have created a class for each object seperately but how do I model the fact that a book contains pages, a type contains books which contain pages, and a library contains types which contain books which contain pages At first I created a parent container (ArrayList) for each class that contained the child objects but that seems akward at best. I looked up "nested classes" but that caused my eyes to glaze slightly as I'm a novice programmer. I would like to reference an object like:
DallasLib.Fiction.Gone With the Wind.Page(201).Display
or
DallasLib.Fiction.Gone With the Wind.Print
or DallasLib.Fiction.CountBooks etc. etc....
How do I model a class that contain objects of a child class The main class that gets the most action is the Book class but I'm not sure that matters on this question.
DeBug