Dependency Inversion Principle

Software Design

Authors

  • Kate Holdener Saint Louis University

Abstract

The Dependency Inversion Principle forces us to depend on abstractions (in Java, it’s abstract interfaces) rather than on concrete implementations. When we apply DIP, our modules can make calls to other modules that they do not depend on (can compile without them). This gives our software more flexibility by making it easier to make software changes later. The students are presented with a model where classes depend on concrete implementations, followed by a model that utilizes dependency on abstractions. Students are challenged to invent the rule behind the DIP and identify the benefits of depending on abstractions. After completing this activity the students are expected to be able to explain how the dependency is inverted in the Dependency Inversion Principle (DIP), explain the benefits of applying DIP, and apply DIP to other software designs.

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: dependency inversion principle (DIP)

Downloads

Published

2023-01-08

How to Cite

Holdener, K. (2023). Dependency Inversion Principle: Software Design. POGIL Activity Clearinghouse, 3(4). Retrieved from https://pac.pogil.org/index.php/pac/article/view/262

Issue

Section

CS-POGIL Activity Writing Program