gpt4 book ai didi

java - STL 库与 JCF 框架

转载 作者:搜寻专家 更新时间:2023-10-31 01:15:42 28 4
gpt4 key购买 nike

为什么 STL 被认为是库,而 JCF 是框架?在他们各自的设计中究竟是什么导致/证明了这种区别?你能给出一个代码示例来说明这一点吗?

最佳答案

Martin Fowler 的定义:

A library is essentially a set of functions that you can call, these days usually organized into classes. Each call does some work and returns control to the client.

A framework embodies some abstract design, with more behavior built in. In order to use it you need to insert your behavior into various places in the framework either by subclassing or by plugging in your own classes. The framework's code then calls your code at these points.

您可以在这里找到更多讨论: What is the difference between a framework and a library?

关于java - STL 库与 JCF 框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9811954/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com