Crazy.Coder --- have more fun in coding

世界上唯有两样东西能使我们的心灵受到深深的震撼,一是我们头顶上璀灿的星空,另一个便是人们内心深处的道德法则。 -- 康德

公告

统计

  • 随笔 - 42
  • 文章 - 0
  • 评论 - 62
  • 引用 - 0
framework vs. library
记得一直对这个问题没有一个很清晰的答案,今天看到Martin Fowler的一段文字,觉得很有道理,记录一下。

Inversion of Control is a key part of what makes a framework different to a library. 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.

摘自:http://martinfowler.com/bliki/InversionOfControl.html



posted on 2007-08-09 23:46 CrazyCoder 阅读(...) 评论(...) 编辑 收藏