简体   繁体   中英

How .NET collections and generics works?

I am a trainee software engineer, I did self study on collection and generics and reported to my TL. He suggested me to study these things also.

Specially in generics how memory is defined for generic type, how IL and CLR works for generic?

Performance of generic over collection, or over boxing unboxing?

I googled but getting confined answer. Can please anybody explain or give any matter(Link) on that to study.

Thanks.

Design and Implementation of Generics for the .NET Common Language Runtime by Andrew Kennedy and Don Syme talks about the theory behind implementing generics on the CLR. http://research.microsoft.com/pubs/64031/designandimplementationofgenerics.pdf

The source code is available for the .NET Framework, which allows you to debug through System.Collections.Generic. http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx

If you want deeper information, you can read the Rotor (aka Shared Source Common Language Infrastructure) source code, which is the "source available" part of the .NET Framework. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8c09fd61-3f26-4555-ae17-3121b4f51d4d&displaylang=en

Another implementation is the Mono project. They have an implementation of generic collections and the Mono codebase is open source. http://www.mono-project.com/Main_Page

A very nice tool for looking at .NET internals is Reflector . It shows the full C# (or VB, or IL) code of many .NET classes, including the collections.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM