11.1. How Behavior Affects State

Back in Chapter 3, we defined the state of an object as the collective set of all the object's field values at a given point in time, including the following:

  • The values of all the "simple" fields for that object—in other words, fields that don't represent other domain objects

  • The values of all the reference variable fields representing links to other domain objects

Table 11-1 repeats the list of the Student class fields from Chapter 6, adding a column to indicate which category each field falls into.

Table 11.1. Student Class Fields
Field NameData TypeRepresents Link(s) to an SRS Domain Object?
namestringNo
studentIDstringNo
birthdateDateTimeNo
addressstringNo
majorstringNo
gpadoubleNo
advisorProfessorYes
courseLoad

Get Beginning C# 2008 Objects: From Concept to Code 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.