Single Responsibility Principle
Software Design
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
How to Cite
Issue
Section
License
Copyright of this work and the permissions granted to users of the PAC are defined in the PAC Activity User License.