Overview

Today we’re going to focus on applying the principles of good design to classes and revisit some of the design principles from earlier in the term.

Basic Learning Objectives

Before class, you should be able to:

  • Identify similarities between effective function design and class design
  • Define the single responsibility principle
  • Define cohesion
  • Define the open-closed principle

Advanced Learning Objectives

After class, you should be able to:

  • Write and refactor classes to have a single responsibility, tight cohesion, and follow the Open-Closed principle

Readings

To achieve the basic learning objectives, read the following in Clean Code (the parts that refer to Java specifically are still generally applicable in Python):

  • Ch 10 “Classes”

Checks

Complete the prep check on Moodle.