Article Options
Premium Sponsor
Premium Sponsor

 »  Home  »  .NET Framework  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
 »  Home  »  .NET Newbie  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
 »  Home  »  Data Programming  »  ADO.NET  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
 »  Home  »  Reviews  »  Book Reviews  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
 »  Home  »  Visual Studio 2005  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
 »  Home  »  Windows Development  »  Win Forms  »  Book Review: Murach's C# 2005  »  Walkthrough: Section 3
Book Review: Murach's C# 2005
by Scott Waletzko | Published  06/15/2006 | .NET Framework .NET Newbie ADO.NET Book Reviews Visual Studio 2005 Win Forms | Rating:
Walkthrough: Section 3

The third section of "C# 2005" covers object-oriented programming, including class and structure design, indexers, delegates, events, inheritance, interfaces, and generics. Beginning programmers may be well served to take a break between sections 2 and 3 and become more familiar with everything they have learned up until that point, because these are advanced concepts relative to what is covered in the previous chapters.

The section starts off with a comprehensive chapter covering class design, beginning with an introduction to the concepts of using classes ("How classes can be used to structure an application", "The members you can define for a class", "How instantiation works"), moving into the details of class design (covering fields, properties, methods, constructors, and static methods), and closing with a discussion of how to create and use structures.  

Chapter 13 covers a few miscellaneous class design concepts, including the use of indexers, delegates, events, and operators. Operator overloading is explained, at which time the author also explains the use of the virtual Equals and GetHashCode methods of the base Object class.

The next topic covered is inheritance. The chapter begins with an overview of class inheritance, a correlation to how inheritance is used in the .NET framework classes, and an explanation of how inheritance can be used by the reader to develop robust applications. Specifics are then covered ("How to create a base class", "How to create a subclass", "How polymorphism works"), and related code examples are given via the book's sample application. Before moving on, the Type class, casting inherited classes, and the concepts of sealed and abstract classes are discussed. Inheritance can be a tricky concept to pick up, and the author does a great job of explaining the process conceptually and then by example in this chapter.

Chapter 15 introduces interfaces and generics. The first part ("How to work with interfaces") walks the reader through interface implementation concepts and practices in much the same fashion as the previous chapter did with inheritance, illustrating some of the common interfaces defined within the .NET framework and how and why to implement them. Also covered is referring to instantiated classes by their interface and passing interfaces as parameters, key points towards understanding why use of interfaces is important towards proper object-oriented development.

The pages about generics introduce this concept (new to Visual Studio 2005), illustrate how to code classes that use generics ("How to code a class that defines a generic collection"), introduce some generic interfaces in the .NET framework library and how (and why) to use them ("How to implement the IComparable<> interface", "How to implement the IEnuerable<> interface"), and  illustrate how to write interfaces that use generic members ("How to code an interface that uses generics", "How to use contraints").

"Chapter 16 - How to organize and document your classes" rounds out the section by introducing the Visual Studio Xml documentation methods, examining class libraries ("How class libraries work", "How to create a class linrary project", "How to add a reference to a class library"), and discussing the different ways to define classes (more than one class per file, partial classes across multiple files) in Visual Studio 2005.

 

Sponsored Links