J
Julie
Hello everyone,
You will have to forgive my newbish questions...
I have a class that has a sub collection class.
Public Class Item
Public Collection As ItemCollection
Public Class ItemCollection
Inherits Generic.List(Of Item)
End Class
End Class
I have two questions:
1. When is it appropriate to use a sub class like above? I got the idea from
System.Windows.Forms.Control. But when i look at
System.Windows.Forms.TreeNode, it doesn't have its collection class as a sub
class (System.Windows.Forms.TreeNodeCollection). Is there a web site the
defines the best practices for class and subclass usage?
2. If i were to inherit Item into ItemDetail, the ItemCollection wouldn't be
type specific for ItemDetail. So what would I do in this case? Create
another sub collection class? I don't think ItemDetailCollection could
inherit ItemCollection.
I'd appreciate any help anybody can give me.
Thank you very much in advance,
Julie.
You will have to forgive my newbish questions...
I have a class that has a sub collection class.
Public Class Item
Public Collection As ItemCollection
Public Class ItemCollection
Inherits Generic.List(Of Item)
End Class
End Class
I have two questions:
1. When is it appropriate to use a sub class like above? I got the idea from
System.Windows.Forms.Control. But when i look at
System.Windows.Forms.TreeNode, it doesn't have its collection class as a sub
class (System.Windows.Forms.TreeNodeCollection). Is there a web site the
defines the best practices for class and subclass usage?
2. If i were to inherit Item into ItemDetail, the ItemCollection wouldn't be
type specific for ItemDetail. So what would I do in this case? Create
another sub collection class? I don't think ItemDetailCollection could
inherit ItemCollection.
I'd appreciate any help anybody can give me.
Thank you very much in advance,
Julie.