코드 작성 잘하기
-
SOLID한 코드를 써보자Apple🍎/Architecture pattern 2024. 7. 25. 22:36
단일 책임 원칙 (SRP)class AccountManager { func createAccount(for user: User) -> Account { /* ... */ } func closeAccount(_ account: Account) { /* ... */ }}class TransactionProcessor { func deposit(amount: Decimal, to account: Account) { /* ... */ } func withdraw(amount: Decimal, from account: Account) throws { /* ... */ }}class AuthenticationService { func login(username: String, passwo..