Why are IOC containers unnecessary with dynamic languages

后端 未结 9 1469
慢半拍i
慢半拍i 2020-12-04 12:13

Someone on the Herding Code podcast No. 68, http://herdingcode.com/herding-code-68-new-year-shenanigans/, stated that IOC containers had no place with Python or Javascript,

9条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 12:56

    I have a different opinion. I think IOC containers certainly have a role in dynamic languages.

    I do not share the opinion that a language being dynamic removes the need for a clearly structured composition of objects. Or that a dynamic language 'provides' the same functionality.

    An IOC container is simply a tool to manage this organization.

    Even in a dynamic language I want to 'wire' together components. Without making hard dependencies between those components. Or maybe even without specifying the actual implementation class for those components.

提交回复
热议问题