VB Code:
Public Class ConnectionManager
Private _connections As ConnectionCollection
Public ReadOnly Property Connections(ByVal index As Integer) As Connection
Get
If Me._connections Is Nothing Then
Me._connections = New ConnectionManager
End If
Return Me._connections(index)
End Get
End Property
End Class
Now all the caller can do is get a reference to a specific Connection object from the collection by providing an index. The property is ReadOnly so they cannot assign a new object to that index and they have no access to the collection itself.