Problem Statement
Which class best follows Single Responsibility in a payments module?
Explanation
A focused class is easier to change and test. If its reason to change is “how we charge,” it stays cohesive and stable.
Auxiliary work like email or invoicing belongs to separate collaborators invoked by higher-level flows.
Code Solution
SolutionRead Only
class ChargeProcessor{ charge(req:ChargeRequest): ChargeResult }Practice Sets
This question appears in the following practice sets:
