Home > Microsoft .Net Development Tips > Chapter Downloads > Book Excerpt: .NET 2.0 Generics guidelines
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

CHAPTER DOWNLOADS

Book Excerpt: .NET 2.0 Generics guidelines


Tod Golding
07.13.2006
Rating: --- (out of 5)


Office Development Channel
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


The Generics class introduced in .NET 2.0 gives developers the flexibility to write methods once and then let the .NET Framework take care of type issues. This class is a tremendous asset -- there is no boxing of objects or casting of exceptions, which improves performance, compile errors show up earlier in the coding process, and generics are implemented right into the Common Language Runtime.

Professional .NET 2.0 Generics by Tod Golding covers many aspects of this implementation, from methods and delegates to reflection, serialization and remoting. Golding provides code samples in both VB and C# and also includes chapters for using generics in C++ and J#.

Chapter 10, Generics Guidelines, provides what the author describes as an "evolving list" of guidelines for working with the Generics class in .NET 2.0. Golding offers nearly two dozen suggestions, from the use of generic collections and consistent Type Parameter names to using the least specialized interface in your APIs.

Golding emphasizes that the guidelines are not steadfast rules:

"Guidelines can and should be violated under certain circumstances. They exist purely to help you define the rules that should shape your general practices for deciding how and when to use a generic type. When you find exceptions to the rule, by all means—violate the rule. Just be sure that you can defend each violation and, if you can, you'll be fulfilling the spirit of what the guideline is trying to achieve."

Read the rest of the excerpt in this PDF.

MORE: Read Chapter 4, Generic Classes


Excerpted from the Wrox Press book, Professional .NET 2.0 Generics (ISBN 0-7645-5988-5) by Tod Golding.
Copyright © 2005. Published by John Wiley & Sons Inc.. Reprinted with permission.

Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


RELATED CONTENT
C# Development
Let Microsoft StyleCop tame your wild C#
Picking a .NET smart client communications technology
LINQ beyond queries: Strong-typed refection
Book excerpt: An introduction to DSL tools
Assembly versioning in the .NET Framework 2.0
Book excerpt: Creating graphical output using the .NET Compact Framework
On Extension Methods in C# and .NET Framework 3.5
Generate RSA public and private keys, export to XML
Book excerpt: Upgrading to Visual Studio 2005
Learning .NET: Tips for getting started with .NET development

Visual Basic and Visual Basic .NET
Compose XML more quickly using Visual Basic 9
Virtualization keeps Legacy Apps alive
VB 9 Anonymous Types help create flexible objects
Visual Studio Team System Add-ins: Conchango Scrum for Team System and Scrum Dashboard
Book Excerpt: Sams Teach Yourself Visual Basic 2008 in 24 Hours -- Complete Starter Kit
Check out CodePlex for a ton of interesting .NET projects
Book excerpt: Murach's VB 2008
Book excerpt: Printing in Visual Basic 2005
Visual Basic 2008 and closures
WinForms development using SQL Server 2005 and Visual Basic 2005

Chapter Downloads
Advanced Windows Debugging Book Chapter and Podcast
Book excerpt: Murach's VB 2008
Book excerpt: Building personalized solutions in SharePoint 2007
Book excerpt: Java EE and .NET security interoperability
Book excerpt: Building document management solutions in SharePoint 2007
Book excerpt: .NET Framework Design Guidelines
Book excerpt: Advanced Windows Debugging
Book excerpt: Pragmatic unit testing in C# with NUnit
Book Excerpt: Executing activities in Windows Workflow Foundation
Book excerpt: Hands-on Windows Communication Foundation

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.

About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts