Sunday 2 October 2011

When to Decide to Use a Collection?

                    Sometimes the answer is obvious, sometimes it is not. A collection is used to tie certain items that have a similar nature together in one set and refer to them as one group of data. As an example, when you need to store some data about your customers, you can obviously use a collection for this purpose. As a guideline you should use a collection when you have more than one item that serve similar purposes and all have the same importance, when the number of items are unknown at design time, when you need to sort items, when you need to iterate through items, or when you need to expose the items to a consumer that expects collection type

No comments:

Post a Comment