KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In many projects I work on, whenever I have to return a read only collection, I use the IEnumerable<T> interface and make it type specific like so: Public ReadOnly Property GetValues() As IEnumerable(Of Integer) Get 'code to return the values' End Get End Property Most of the time, I return a List but in some functions and read only properties I return an array which also serves the purpose alright by kind courtesy of Extension Methods. My question is am I violating any design principles by returning IEnumerable<T> s instead of specific types (e.g.: List<T> , HashSet<T> , Stack<T> or Array s) ?
Tags (comma-separated)
Save Edits
Cancel