CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 1 of 7 · 1 min read

Why this page comes second

In this module you will

  • State the open-closed principle (OCP) and say why it sounds contradictory but is not.
  • Recognise the if and switch chains that break it.
  • Rewrite such a chain using an interface and a list of small classes.
  • Add a new case to the rewritten code without touching old code.
  • Say when not to apply OCP, because it has a cost.

Module 1 split code by who asks for changes. This page covers what to do when that group does ask: a new price rule, a new report, a new payment type. The sources are "Clean Architecture" (CA), chapter 8, and "Head First Design Patterns" (HF), chapter 3. Code was compiled and run before it was written here. Numbers marked "made up" only show the idea.