Dependency Injection for Procedural Programming

后端 未结 5 679
野性不改
野性不改 2021-02-13 23:00

Suppose I\'ve decided to write a large application in C, or any other procedural programming language. It has functions with call-dependencies that look like this:



        
5条回答
  •  清歌不尽
    2021-02-13 23:37

    you can put the dependencies to a c-struct that will become one parameter for the function call. in c this would be similar to the file api where the first parameter is always the file-handle

提交回复
热议问题