Skip to content

CC12: Objects and Data Structures

Due January 28Estimated duration: 90 minutes

Read CC12 and the definition of SRP in CC19.

Select either some object-oriented code you have written in the past or open source code as in previous assignments. Your selection must contain at least two class definitions. For each class:

  • explain whether it is a data structure or object by Martin’s definition, or if it is not clearly one or the other, what changes are required to make it one or the other.
  • if the class satisfies SRP, state its responsibility, and if not, explain why.

For the purpose of SRP analysis, it helps to think about to whom a class is responsible. That is, who in the organization could make a choice that would mean that the class has to change? Consider, for example, is the class beholden to the decisions of an experience designer, a business analyst, a serialization format, or a regulatory agency?