This article clearly explains the Open/Closed Principle (OCP) and demonstrates it with a practical Java example of discount strategies. By adhering to OCP, the system allows new discount types to be added without modifying existing code, which enhances flexibility and maintainability. The inclusion of a GitHub Actions automation workflow adds an extra layer of practicality by ensuring the code is consistently tested with every change.