advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Serializing, Consuming, and Binding Generics in .NET 2.0

Generics are a powerful new feature in .NET 2.0, but it's not so obvious how to use them as return values from Web services, or how to bind them to controls. Find out how to serialize, data bind, and consume generic collections in ASP.NET 2.0 


advertisement
enerics, a new feature introduced with .NET 2.0, provides type safety at compile time. Generics let you create data structures without committing to a specific data types in your code at design time. At compile time, the compiler ensures that the types used with the data structure are consistent with type safety. In other words, generics provide type safety, but without any loss of performance or code bloat. While they are similar to templates in C++ in this regard, their implementation is very different.


This article discusses the application of generics in .NET development and different ways in which you can leverage generic types and collections within a .NET application.

What are Generics?
Generics are code templates generalized to use the same code repeatedly with different data types without needing to rewrite any of the internal code, and thus increasing the reusability of your software components. Within the data structure, member or argument usage adapts to different data types. Generics let you avoid those all-too-common, messy, and resource-intensive conversions from reference types to native types, creating routines that are much more type-safe.

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement