I compiled a list of collaboration-related terms that were new to me.
Possession Authentication vs. Identity Authentication
ICE Scoring
A decision-making framework known for being fast and effective.
ICE (Impact, Confidence, Ease)
Source - Super Fast Decision Making - ICE Scoring
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.