Mostly in my applications for given class when there is need to create collection i do it in separate class like as presented below. As you are experts here i would like to ask you whether am i doing that correctly in context of OOP programming. Awaiting your opinions especially i saw in that some people sometimes for their collection class inherits e.g from ICollection or IList but don't get the point - please tell what is the difference then between my collection class and their once. If there is something i have to know please also some samples what could be modified or whatever. Thanks in advance.Regular class:Public Class Variation        Inherits Base        Implements IComparable(Of Variation)'Properties..'Constructor..'Some methods..#Region list features: compare, sort etc..'this is required for sorting        Public Function CompareTo(pother As Variation) As Integer Implements IComparable(Of Variation).CompareTo    'we can sort because of this            Return String.Compare(Me.Position, pother.Position)        End Function        Public Function FindPredicate(ByVal pvariation As Variation) As Predicate(Of Variation)            Return Function(pvariation2 As Variation) pvariation.Id = pvariation2.Id        End Function        Public Function FindPredicateByUserId(ByVal pvariation As String) As Predicate(Of Variation)            Return Function(pvariation2 As Variation) pvariation = pvariation2.Id        End Function#End RegionCollection class: (this case for List)    Public Class Variations        Implements IDisposable        Public Collection As List(Of Variation)        Sub New()            Collection = New List(Of Variation)        End Sub        Public Function AddToCollection(ByVal variation As Variation) As Boolean            Collection.Add(variation)            Return True        End Function        Public Sub RemoveFromCollection(index As Integer)            If Not IsNothing(Collection.Item(index)) Then                Collection.RemoveAt(index)            End If        End Sub        Public Sub SortByPosition()            Collection.Sort()        End Sub#Region IDisposable Support        Private _disposedValue As Boolean ' To detect redundant calls        ' IDisposable        Protected Overridable Sub Dispose(disposing As Boolean)            If Not Me._disposedValue Then                If disposing Then                    ' TODO: dispose managed state (managed objects).                End If                ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below.                ' TODO: set large fields to null.            End If            Me._disposedValue = True        End Sub        ' This code added by Visual Basic to correctly implement the disposable pattern.        Public Sub Dispose() Implements IDisposable.Dispose            ' Do not change this code.  Put cleanup code in Dispose(ByVal disposing As Boolean) above.            Dispose(True)            GC.SuppressFinalize(Me)        End Sub#End Region    End Classother Collection class: (this case for Dictionary(Of x, x))for some Artikel class:Imports BAL.ArticleNamespace Collections    Public Class ArticlesVariations        Public Property Collection As Dictionary(Of Integer, Artikel)        Sub New()            Collection = New Dictionary(Of Integer, Artikel)            '-- new collection object        End Sub        Sub New(pId As Integer, pArtikel As Artikel)            Collection.Add(pId, pArtikel)        End Sub        '-- Get next number of article to be added to new article        Public Function GetNextArtikelNumber()            Dim lastValue As Artikel = Collection(Collection.Keys.Max())            Dim newnumber As String = TextUtils.IncreaseNumberAtTheEnd(lastValue.Nummer, 1, .)            Return newnumber        End Function        '-- Delete from collection just deleted articles and their combination        Public Sub RemoveAllMarkedAsDeleted(keys As List(Of Integer))            '-- Check whther anything has been marked as deleted            If keys.Count > 0 Then                For Each row In keys                    Collection.Remove(row)                Next                ReorderKeys()            End If        End Sub        '-- Unfortunetly we cannot change dictionary collection keys, so we have to create new collection to reorder keys when something was deleted to keep correct order        Private Sub ReorderKeys()            Dim newCollection As New Dictionary(Of Integer, Artikel)            Dim index = 0            For Each collitem In Collection                newCollection.Add(index, collitem.Value)                index += 1            Next            Collection.Clear()            Collection = newCollection        End Sub        '-- Check and if required rechange articles numbers from 1 to ...        Private Sub UpdateArtikelNumbers()            If Collection.Count > 0 Then                For i = 0 To Collection.Count - 1                    Dim artikelNUmmer As String = Collection.Item(i).Nummer                    Dim lastDigit As String = artikelNUmmer.Last                    If CInt(lastDigit) <> i + 1 Then                        lastDigit = i + 1                        Collection.Item(i).Nummer = TextUtils.RemoveAllAfterLastOccurenceOf(., Collection.Item(i).Nummer, True) + lastDigit                        'CStr(collection.Item(i).Nummer.Substring(0, collection.Item(i).Nummer.Length - 1) & lastDigit)  'Remove last char and add lastChar - to nie dzialalo prawidlowo                    End If                Next            End If        End Sub        '-- Get current collection object        Public Function GetCollection() As Dictionary(Of Integer, Artikel)            Return Collection        End Function        '-- Get whether empty list (if no images for given article) or existing path's list        Public Function GetImagesForArticle(partikelNummerOrKey As String) As List(Of ArticleImage)            Dim imgList As New List(Of ArticleImage)            'dla modulu Newartikel - tutaj nie ma jeszcze numerow artykulow - stad pobieramy zdjecia w/g indexow kolekcji            If Not _isEditModule Then                If Collection.Count > 0 Then                    imgList = Collection.Item(CInt(partikelNummerOrKey)).ArtikelImages             '-- get images list for that article                End If            Else                If Collection.Count > 0 Then                    For i = 0 To Collection.Count - 1                        Dim artikelNummer As String = Collection.Item(i).Nummer                        If artikelNummer = partikelNummerOrKey Then                      '-- search for article in collection                            imgList = Collection.Item(i).ArtikelImages             '-- get images list for that article                            Exit For                        End If                    Next                End If            End If            Return imgList        End Function        '-- Pass artikel nummer and current images list for it. old one will be completly decomissed        Public Sub AddImagesToArticle(partikelNummerOrKey As String, pImages As List(Of ArticleImage))            'dla modulu Newartikel - tutaj nie ma jeszcze numerow artykulow - stad dodajemy zdjecia nie do numerow artykulow, ale do indexow kolekcji            If Not _isEditModule Then                If Collection.Count > 0 Then                    Collection.Item(CInt(partikelNummerOrKey)).ArtikelImages = Nothing                    Collection.Item(CInt(partikelNummerOrKey)).ArtikelImages = pImages                End If            Else                If Collection.Count > 0 Then                    For i = 0 To Collection.Count - 1                        Dim artikelNummer As String = Collection.Item(i).Nummer                        If artikelNummer = partikelNummerOrKey Then                            Collection.Item(i).ArtikelImages = Nothing                            Collection.Item(i).ArtikelImages = pImages                            Exit For                        End If                    Next                End If            End If        End Sub    End ClassEnd Namespace
Collection class for specific class
reinventing the wheel;vb.net;collections