垫片的定义是什么?
发布于 2015-07-05 04:53:54
根据维基百科的定义,术语"shim“在技术上可以被归类为”结构化“设计模式。许多类型的“结构化”设计模式在(有些人会说是事实上的)面向对象软件设计模式参考"Design Patterns, Elements of Reusable Object-Oriented Software" (更为人所知的是"Gang of Four" )中有非常清晰的描述。
"Gang of Four"文本概述了至少3种公认的模式,即“代理”、“适配器”和“门面”,它们都提供了“填充”类型的功能。在大多数领域中,经常会使用和/或遗漏使用同一根概念的不同缩写词,这会导致人们感到困惑。使用“填充”这个词来描述更具体的“结构化”设计模式"Proxy"、"Adapter"和"Facade"无疑就是这种情况的一个明显的例子。"shim“只是一个更一般的术语,表示更具体类型的”结构化“模式”代理“、”适配器“、”外观“以及其他可能的类型。
发布于 2010-01-22 17:15:38
至于这个词的起源,苹果公司的Dictionary小工具说
noun
a washer or thin strip of material used to align parts,
make them fit, or reduce wear.
verb ( shimmed, shimming) [ trans. ]
wedge (something) or fill up (a space) with a shim.
ORIGIN early 18th cent.: of unknown origin
这似乎非常符合网页设计师使用这个术语的方式。
发布于 2012-10-20 20:43:43
.net 4.5 Microsoft Fakes框架to isolate your application from other assemblies for unit testing中使用了填充符。填充符将对特定方法的调用转移到您作为测试的一部分编写的代码中
https://stackoverflow.com/questions/2116142
复制相似问题