术语“挂钩"的含义是什么?在编程中? [英] What is meant by the term "hook" in programming?
问题描述
我最近在与一些人谈论我正在编写的程序时听到了挂钩"一词.尽管我从对话中推断出挂钩是一种函数,但我不确定该术语的确切含义.我搜索了一个定义,但找不到一个好的答案.有人可以让我了解这个术语的一般含义,也许还可以举一个小例子来说明这个定义?
I recently heard the term "hook" while talking to some people about a program I was writing. I'm unsure exactly what this term implies although I inferred from the conversation that a hook is a type of function. I searched for a definition but was unable to find a good answer. Would someone be able to give me an idea of what this term generally means and perhaps a small example to illustrate the definition?
推荐答案
从本质上讲,它是代码中的一个地方,允许您使用模块来提供不同的行为或在发生某些事情时做出反应.
Essentially it's a place in code that allows you to tap in to a module to either provide different behavior or to react when something happens.
这篇关于术语“挂钩"的含义是什么?在编程中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!