M
Mike
I have several classes that will have a property of type List (of
whatever).
For example, I will have collections named:
Protocols that will have a property named Items as List (of Protocol).
Orders that will have a property named Items as List (of Order).
Etc.
All this classes will have their own Add, Remove, Count, etc, method.
So for example, the Add method of the orders class will be as follows:
Public sub Add(NewOrder as Order)
Me.m_Items.Add(NewOrder)
End Sub
It is very repetitive to create and Add, Remove, etc, method for every
class that will implement this functionality, so I thought about
creating a base class named SpecializedCollectionBase that will contain
an Add, Remove, etc method, and the rest of the classes can inherit from
it.
The only problem that I see with this is that SpecializedCollectionBase
won’t know of what type is the Items property of the class that is
inheriting.
It can be of Order, of Protocol, etc.
I hope you understand my point and can help me to make this more
efficient.
Thanks
whatever).
For example, I will have collections named:
Protocols that will have a property named Items as List (of Protocol).
Orders that will have a property named Items as List (of Order).
Etc.
All this classes will have their own Add, Remove, Count, etc, method.
So for example, the Add method of the orders class will be as follows:
Public sub Add(NewOrder as Order)
Me.m_Items.Add(NewOrder)
End Sub
It is very repetitive to create and Add, Remove, etc, method for every
class that will implement this functionality, so I thought about
creating a base class named SpecializedCollectionBase that will contain
an Add, Remove, etc method, and the rest of the classes can inherit from
it.
The only problem that I see with this is that SpecializedCollectionBase
won’t know of what type is the Items property of the class that is
inheriting.
It can be of Order, of Protocol, etc.
I hope you understand my point and can help me to make this more
efficient.
Thanks