Chapter 8: Introduction to Object-Oriented Programming


Overview

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 is essential: in Windows Forms applications. This type of application (which makes use of the Windows environment with features such as menus, buttons, and so on) provides plenty of scope for description, and you will be able to illustrate OOP points effectively in the Windows Forms environment.

In this chapter you learn:

  • What object-oriented programming is

  • OOP techniques

  • How Windows Forms applications rely on OOP

    Note

    Note that OOP as presented in this chapter is really .NET OOP and that some of the techniques presented here don't apply to other OOP environments. When programming in C#, you use .NET-specific OOP, so it makes good sense to concentrate on these aspects.




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net