Introduction
In our discussions of object-oriented applications in the preceding chapters, we introduced many basic concepts and terminology that relate to C# object-oriented programming (OOP). We also discussed our application development methodology: We selected appropriate variables and methods for each application and specified the manner in which an object of our class collaborated with objects of classes in the .NET Framework Class Library to accomplish the application's overall goals.
In this chapter, we take a deeper look at building classes, controlling access to members of a class and creating constructors. We discuss compositiona capability that allows a class to have references to objects of other classes as members. We reexamine the use of properties and explore indexers as an alternative notation for accessing the members of a class. The chapter also discusses static class members and readonly instance variables in detail. We investigate issues such as software reusability, data abstraction and encapsulation. Finally, we explain how to organize classes in assemblies to help manage large applications and promote reuse, then show a special relationship between classes in the same assembly.
Chapter 10, Object-Oriented Programming: Inheritance, and Chapter 11, Polymorphism, Interfaces & Operator Overloading, introduce two additional key object-oriented programming technologies.
Time Class Case Study
|