Part 5: Convenience features

Introduction

Compared to Java, C# has several features that make things more convenient for the developer. Instead of accessor (getter) and mutator (setter) methods, we have C# properties. Besides being a cleaner and more elegant way of implementing getter and setter methods, public properties act and feel exactly like public fields to external parties - without the associated 'it-is-poor-programming-practice-to-make-your-fields-public' stigma.

C# also comes with indexes, operator overloading (a feature of C++ which Java dumped), and user-defined casting operations. These features are not really essential for an OO language and their functionality can be implemented using common methods. Nevertheless, additional convenience features like these add to the power developer's tool box. The downside is that the learning curve is increased a bit.

The first chapter (Chapter 20) is a 'must read' because properties are very commonly employed in C# applications. Tackle the remaining chapters of this part at your own pace.


The chapters in this part are:
 

Chapter 20: C# properties

 

Chapter 21: C# indexes

 

Chapter 22: Operator overloading

 

Chapter 23: User-defined conversions/casts.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.106.237