You will learn about the following in this chapter:
The CPassword class example in Chapter 15, "Encapsulation," uses class members that you never need to read or write directly. That is, in Chapter 15 you never really have a reason to access mUserList() or mUserCount directly. In many situations, however, you need to write class code where access to the member variables of the class is important. Recall from Chapter 3, "Thinking About Programs," that class member variables represent the properties of the class. Collectively, the values of the properties define the current state of an object of the class. Unlike the CPassword class from Chapter 15, this chapter presents an example in which you want to alter the values of the properties. This chapter shows you how to use property values to affect the state of a class object. As you work through the example presented in this chapter, I hope you feel the same sense of awe I did the first time I used these elements of Visual Basic .NET. There are some pretty bright people in Redmond who have made our lives a whole lot easier. To those people thanks! As always, the starting point for any program is to grab a piece of paper and start scratching out a design. |