I'm a Ruby coder. For me, monkeypatching is to change, at runtime, classes or modules methods in an external project. What I'm interested in, is what mechanism you have in place that will protect you from some of the abuses of that nice feature. Follows, some scenarios that I have encountered, where monkeypatching has bitten me.
While I don't know Smalltalk at all, that language have been there long before Ruby. I have done some research to see if and how Smalltalk solved some of these problems but didn't find much on Google. So here I am, asking for Smalltalkers if they can share their wisdom.
Scenario A : bug fixing conflict
Project A and B depend on project C. Project C has a bug. Project A and B releases contain a fix for project C.
If your code uses Project A and B, how can you know the patches won't conflict ?
Scenario B : outdated bug fixing
Project C releases a fixed minor version of their project.
If you load project A, will the patch still be applied, with potential breakage ? I'm interested to know if there are some mechanism in place, for example, to not load the patch if the code is fixed.
Scenario C : conflicting extensions
Project A and B use project C's class Foo. Both add a utility method to Foo, say, #toDate. The toDate version of A returns a date string, and the one of B a Date object.
If you load both projects (with C dep), is there a mechanism that will warn/prevent the conflict ? Or will you have to wait until runtime throws an error because of a wrong expectation in a method ?
About the question update
Reading the answers, I realise my question was too broad and vague. So here is a rewritten version of it.