机制 策略

机制mechanism 策略 policy。Xwindow的设计准则里边有一条:提供机制,而不是提供策略。不明白,g之。

 

机制就是提供的功能,比如在驱动程序的编写中,你要提供怎样和硬件交流的方式,这就叫机制。 而策略则是指你怎样去使用已有的机制完成你自己的特定的功能,比如在驱动程序的编写中,你该怎样去利用硬件机制完成特定的功能。

不仅仅在驱动方面,在很多,如网络安全方面都有相应的概念。

 

The distinction between mechanism and policy is one of the best ideas behind the
Unix design. Most programming problems can indeed be split into two parts:
“what capabilities are to be provided” (the mechanism) and “how those capabilities
can be used” (the policy). If the two issues are addressed by different parts of
the program, or even by different programs altogether, the software package is
much easier to develop and to adapt to particular needs.


摘自ldd2英文版。就是说机制(mechanism)是"what", 而策略(policy)是"how"。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值