Methods As Building Blocks: Encapsulating Your Helper Methods with the private keyword.

We can expect the internal parts of each class in a program to be less complex than the overall program, but the programmer is still often confronted with individual classes of relatively high complexity. Fortunately, it is possible to reduce this complexity by dividing its functionality into methods. Let's look at an example.

Notice that this discussion is relevant to step 2c (Identification of methods in each class) and step 2d (Internal method design) of the Software Design phase in the Software Development Process presented in Chapter 2.

Consider a map represented in your source code by a class called Map. One of the services of this class is to calculate ...

Get C# Primer Plus 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.