Number: 005, Date: 2025-02-10

2025.02.03 ~ 2025.02.09

🤝 Collaboration-Related Terms


I compiled a list of collaboration-related terms that were new to me.

Possession Authentication vs. Identity Authentication

Source - The Characteristics and Differences of Identity Authentication and Possession Authentication

ICE Scoring

A decision-making framework known for being fast and effective.

ICE (Impact, Confidence, Ease)

Source - Super Fast Decision Making - ICE Scoring

🌏 Design Pattern In Swift


There is an open-source project called Design-Patterns-In-Swift, which explains design patterns using the Swift language.

Chain of Responsibility Pattern Example

protocol Withdrawing {
    func withdraw(amount: Int) -> Bool
}

final class MoneyPile: Withdrawing {

    let value: Int
    var quantity: Int
    var next: Withdrawing?

    init(value: Int, quantity: Int, next: Withdrawing?) {
        self.value = value
        self.quantity = quantity
        self.next = next
    }

    func withdraw(amount: Int) -> Bool {

        var amount = amount

        func canTakeSomeBill(want: Int) -> Bool {
            return (want / self.value) > 0
        }

        var quantity = self.quantity

        while canTakeSomeBill(want: amount) {

            if quantity == 0 {
                break
            }

            amount -= self.value
            quantity -= 1
        }

        guard amount > 0 else {
            return true
        }

        if let next {
            return next.withdraw(amount: amount)
        }

        return false
    }
}

final class ATM: Withdrawing {

    private var hundred: Withdrawing
    private var fifty: Withdrawing
    private var twenty: Withdrawing
    private var ten: Withdrawing

    private var startPile: Withdrawing {
        return self.hundred
    }

    init(hundred: Withdrawing,
           fifty: Withdrawing,
          twenty: Withdrawing,
             ten: Withdrawing) {

        self.hundred = hundred
        self.fifty = fifty
        self.twenty = twenty
        self.ten = ten
    }

    func withdraw(amount: Int) -> Bool {
        return startPile.withdraw(amount: amount)
    }
}

I revisited design patterns after a long time and found that the Chain of Responsibility example, specifically the ATM object, lacked extensibility. To improve it, I modified the properties to be received as an array.

After this change, the ATM object became much more scalable. Although the ATM object itself is not directly related to the Chain of Responsibility pattern’s purpose, one of the pattern’s strengths is extensibility. I believed it would be beneficial if the objects using it were also extensible, so I contributed the modification.

Additionally, I had previously contributed to the Prototype Pattern example, but my email had changed. I explored ways to modify the commit history in the open-source project, trying git rebase, git-filter-repo, cherry-pick, and format-path.

However:

Although I tried multiple approaches out of curiosity, I concluded that it’s best not to modify past contributions in open-source projects.

🙋🏻‍♂️ Other Notes


  1. I read an interesting article about the failure of a code assistant service called Kite.
  2. If you encounter an LLDB RPC Server Crash Playground error in Xcode 16, check whether the Swift version is set to 6.
  3. I created a GitHub repository while watching the KavSoft SwiftUI tutorial channel and completed lessons 21 to 28.
  4. Useful Android tips:
    1. If an app forcibly increases the volume, enabling Do Not Disturb mode prevents sound from playing.
    2. In Android Studio, pressing Cmd + Shift + F allows you to search the entire project.
  5. A runtime error occurred in a production app, and I identified the issue using Elastic Search logs, which helped trace the error path and resolve it.
  6. I am developing a Flutter project that includes user registration and login using REST API communication.