Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 368 Bytes

1_SRP_code_refactor.md

File metadata and controls

13 lines (9 loc) · 368 Bytes

refactored UserService to better follow SRP */

class ValidationUserService {
  void Validate(User user) { }
}

class BankingUserService {
  void MakePayment(User fromUser, User toUser) { }
}

each class now has a single responsibility */

when we want to change the payment logic for a user, we only change the BankingUserService */