What to make of Generics and Generic Type(s) -(GT's)
Making sense of the use of generics and generic types programming, tools and terminology, implications, risks, rewards and more, quickly have us turning to industry definitions and practical applications. So, what is a generic type?
GT’s refer to a single programming element. It is highly adaptable and flexible, customizable in order to adapt and perform the same functionality for a variety of data types. A master of guises of sorts, wearing many hats, fulfilling many a purpose Generic functions (object-oriented programming solutions) – the same nomer for many methods, sharing the same ‘label’ as it were. Algorithms are written and used to-be-specified-later, types and programming, called upon when needed. Types are these parameters and specifics manifest. These entities are called and used as ‘generics’ (see elsewhere). It effectively reduced duplication and enables broader application, using dynamic delegation principles. Code circumvents static properties, type variables. Lists, hash tables, sorting algorithm objects are examples. Reflection with preservation of generic types are possible and used effectively, for example when using and programming boxing conversions.
C# (and .NET in general) allows six varieties of generic type constraints, keyword, restricting generic types to be value types, classes, have constructors, inherit from interfaces.
Key Exam Points
- Use, contexts, scenarios and application of Generic Type for C# and VB, .NET.
- For the exam, study practical, hands-on, illustrative, examples for Generic Type(s) and generics, that help you to gain a better understanding of this topic
- Take the Practice Tests, Exam mock questions (multiple choice - with solutions), work-lab exercises, application, demonstrable cases.
Nullable Type, Generic, EventHandler, Type Conversion
This article is based on the 2nd edition of the Microsoft .Net Framework Application Training Kit with the purpose to help 70-536 Exam takers to succeed. I constantly look for ways to improve the content. Please leave a comment about this article or drop me a message if you would like to see changes for this site.