Link Details

Link 966859 thumbnail
User 448255 avatar

By dotCore
via visualstudiomagazine.com
Submitted: May 10 2013 / 00:52

In my last column, I discussed how the Microsoft .NET Framework (and its compilers) use interfaces to implement behavior that crosses many different kinds of objects. My example in that column was using the IEnumerable interface in one of your classes to allow your class to work with a For...Each loop. I showed how you could use that knowledge to create a read-only collection. But I also pointed out that creating your own read-only collection was sort of pointless: The .NET Framework already provides the ReadOnlyCollectionBase class to let you create custom read-only collections, and it includes the AsReadOnly extension method for creating read-only collections from existing read-write collections.
  • 2
  • 0
  • 125
  • 23

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)



    Debugging JavaScript
    Written by: Ashutosh Sharma
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Java EE7
    2. Spring Annotations
    3. Git
    4. Java
    5. REST