What exactly is “interface based programming”?

后端 未结 8 1756
有刺的猬
有刺的猬 2020-12-02 14:46

I often hear/read about interfaced based programming but I am not exactly clear on what that really means. Is interfaced based programming an actual stand alone topic that

8条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 15:17

    From a very abstract view, interface based programming is akin to the components used by a plumber (pipe joints and pipes).

    As long as the pipes and the joints are manufactured according to the interface specified (the number of threads and the spacing, etc) various manufactures can provide joints to pipes that were potentially manufactured by some other vendor (but adhering to the aforementioned joint/pipe interface).

    Thus, there is more interoperability of components and freedom for the plumber to choose from various vendors, price ranges etc in order to create a functional plumbing system.

    Replace the pipes and joints with software components and the parallels are astonishingly simple.

提交回复
热议问题