Note that there are some explanatory texts on larger screens.

plurals
  1. POHow does Smalltalk deal with monkeypatching?
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p><strong>Scenario A : bug fixing conflict</strong></p> <p>Project A and B depend on project C. Project C has a bug. Project A and B releases contain a fix for project C.</p> <p>If your code uses Project A and B, how can you know the patches won't conflict ?</p> <p><strong>Scenario B : outdated bug fixing</strong></p> <p>Project C releases a fixed minor version of their project.</p> <p>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.</p> <p><strong>Scenario C : conflicting extensions</strong></p> <p>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.</p> <p>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 ?</p> <p><strong>About the question update</strong></p> <p>Reading the answers, I realise my question was too broad and vague. So here is a rewritten version of it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload