Chapter 2. Class Design

A class represents an abstraction, usually of our application domain. In computer graphics, for example, we manipulate classes representing lights, a camera, geometric shapes such as a sphere, cone, or cube, as well as curves and surfaces, and math classes such as matrices and vectors. In the design of a Windows application, we manipulate classes representing text boxes, buttons, labels, message boxes, and so on. The primary goal of this chapter is to familiarize you with the C# language support for designing and implementing classes.

In general, a class consists of two parts: a public set of operations and properties—called the public interface—and a private implementation. As users of a class, we are consumers of its ...

Get C# Primer: A Practical Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.