Introduction to Object-Oriented Programming
At this point in the book, you've covered all the basics of C# syntax and programming, and have seen how to debug your applications. Already, you can assemble usable console applications. However, to get access to the real power of the C# language and the .NET Framework, you need to make use of object-oriented programming (OOP) techniques. In actual fact, as you will soon see, you've been using these techniques already, although, to keep things simple, I haven't focused on this when presenting the code examples.
In this chapter, you will steer away from code temporarily and focus instead on the principles behind OOP. This will soon lead you back into the C# language, because it has a symbiotic relationship with OOP. All of the concepts introduced in this chapter will be returned to in later chapters, with illustrative code — so don't panic if you don't grasp everything in the first read-through of this material.
To start with, you'll look at the basics of OOP, which will include answering that most fundamental of questions “What is an object?” You will quickly find that there is a lot of terminology related to OOP that can be quite confusing at first, and there will be plenty of explanation of the language used. You will also see that using OOP requires you to look at programming in a different way.
As well as discussing the general principles of OOP, this chapter will also take a look at one area where a thorough understanding of OOP ...