λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

πŸ“– Note

Monkey Patch (멍킀 패치)

A monkey patch is a way for a program to extend or modify supporting system software locally (affecting only the running instance of the program).

ν”„λ‘œκ·Έλž¨μ„ ν™•μž₯ν•˜κ±°λ‚˜, 둜컬 μ‹œμŠ€ν…œ μ†Œν”„νŠΈμ›¨μ–΄λ₯Ό μ§€μ›ν•˜κ³  μˆ˜μ •ν•˜λŠ” 방법이닀(였직 싀행쀑인 ν”„λ‘œκ·Έλž¨μ˜ μΈμŠ€ν„΄μŠ€μ— 영ν–₯을 λ―ΈμΉœλ‹€).

 

πŸ‘‰ Monkeypatching the Standard Library

 

λŸ°νƒ€μž„μƒμ—μ„œ ν•¨μˆ˜, λ©”μ„œλ“œ, 속성을 λ°”κΎΈλŠ” 것을 μ΄μ•ΌκΈ°ν•œλ‹€.

μ†ŒμŠ€μ½”λ“œκ°€ μ—†λŠ” μ„œλ“œνŒŒν‹° μ œν’ˆμ„ μ‚¬μš©ν•˜λŠ” 쀑 κΈ°λŠ₯을 λ³€κ²½ν•˜κ±°λ‚˜ ν™•μž₯을 μœ„ν•΄ μ‚¬μš©ν•œλ‹€.

λŸ°νƒ€μž„ 싀행쀑 λ©”λͺ¨λ¦¬μƒμ˜ μ˜€λΈŒμ νŠΈμ— μ μš©λœλ‹€.

 

κ°€λŠ₯ν•œ μ–Έμ–΄λ‘œλŠ” Javascript, Python, PHP, Ruby λ“±κ³Ό 같은 언어듀이 μžˆλ‹€.

C#κ³Ό Swift의 경우 κΈ°μ‘΄ ν΄λž˜μŠ€λ“€μ˜ κΈ°λŠ₯ 변경을 λΆˆκ°€ν•˜μ§€λ§Œ, ν™•μž₯은 κ°€λŠ₯ν•˜λ„λ‘ ν–ˆλ‹€.