Describing a collection as a "group of objects" is technically correct, but also a bit reductive. The best question is “what is a useful collection?”, Where “useful” offers you to ask yourself “how should I use it”?
Now the Array field in A_List definitely represents a collection (but not a “custom” one), and your A_List (possibly) a collection, but is it useful?
A collection is a group of common objects that you have collected to summarize some operation on all of them. There are many ways you might want to use the collection, but the most common ones are largely standardized in many programming languages. For example, in order for a collection to be “useful,” you usually need at least the ability to read its elements in a direct cycle from the first to the last. Your A_List does not provide this directly. You can easily add your own methods for this, but you can take a step forward and implement the existing interface.
If you implemented IEnumerable<T> in A_List, you could not only go through it, but you could also use your A_List interchangeably with other collections from the large amount of existing code that IEnumerable expects. For example:
class A_list : IEnumerable<A> { // ... your other code public IEnumerator<A> GetEnumerator() { return ((IEnumerable<A>)list).GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return list.GetEnumerator(); } }
will allow you to do this in main :
foreach(var a in just_an_object) { Console.WriteLine(a.Foo); }
Or you can use it with Linq:
var numbered=just_an_object.Zip(Enumerable.Range(0,3),(a,b) => b.ToString() + a.Foo);
An IEnumerable<String> now numbered with three values (0, 1, 2, 2), but that doesn't matter; The important bit is that (by implementing IEnumerable<T> ) just_an_object can be used with the Linq method, which works the same with an Array or List array or most other "standard" collections. Also, note that neither foreach nor Zip needs to know that the list field is an Array , not a List<A> or a red-black tree that you implemented yourself , so you can make it private .
There are other things besides repeating through it that you might want to do with the collection. Adding or removing elements, providing an indexer (so that you can access the nth element with just_an_object[n] ). Like IEnumerable, there are interfaces that let you implement them in a standardized way (look for ICollection and IList).
And then there are "user" aspects. Those that made you decide that you need your custom collection, and not directly with an array or list that already do all this for you out of the box ...