Explore Library
Quiz

Identifying SOLID Violations in Practice

Recognize which SOLID principle is violated when a class must be modified to add new behavior types.

A PaymentProcessor class contains a method with a large switch statement on payment type (credit, paypal, crypto). Every time a new payment method is added, you must edit this method and its switch cases. Which SOLID principle is most directly violated, and what refactor best addresses it?