Single Responsibility Principle

Software Design

Authors

  • Kate Holderer Saint Louis University

Abstract

Single Responsibility Principle (SRP) encourages us to write small modular classes, with methods that directly align with each class’ responsibility. This activity uses different designs of a terminal-based Tic Tac Toe game to illustrate the benefits of SRP. The students compare the design without SRP to an improved design that utilizes SRP to a degree. Finally, the students work through improving the design by applying SRP even further. Finally, the activity challenges the students with a new design problem, giving them to apply SRP to a new context. After completing this activity the students are expected to be able to define SRP, explain the benefits of SRP, and apply SRP to their own design.

This activity was developed with NSF support through IUSE-1626765. You may request access to this activity via the following link: IntroCS-POGIL Activity Writing Program

  • Level: undergraduate
  • Setting: computer classroom
  • Activity type: Learning Cycle
  • Discipline: Computer Science
  • Course: Object-Oriented Software Design
  • Keywords: single responsibility principle (SRP)

Downloads

Published

2023-01-08

How to Cite

Holderer, K. (2023). Single Responsibility Principle: Software Design. POGIL Activity Clearinghouse, 3(4). Retrieved from https://pac.pogil.org/index.php/pac/article/view/347

Issue

Section

CS-POGIL Activity Writing Program