This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
一般来说,这意味着通过提高抽象级别可以使问题更容易理解/解决。
不过,要小心你的抽象,至少我听到的完整引用是,“你可以用另一个间接级别解决每个问题,除了太多间接级别的问题”。
Generally it means that by increasing the level of abstraction one can make the problem easier to understand/resolve.
Be careful with your abstractions though, the full quote at least as I heard it is, "You can solve every problem with another level of indirection, except for the problem of too many levels of indirection".
摘自《美丽的代码》一书:
尽管这是 与维基百科相矛盾,后者将这句话归咎于 David Wheeler。
From the book Beautiful Code:
Although this is contradicted by Wikipedia who attributes the phrase to David Wheeler.
它基本上意味着你应该将问题分解成更小的问题,直到问题很容易解决。
您将问题分为几层:
顶部的例程(解决问题的例程)是从解决问题的实际方法间接/抽象出来的,使它们能够更灵活地在以后以稍微不同的方式解决相同的问题。
It basically means that you should break your problem into smaller problems until the problems are easy to solve.
You break the problem into several layers :
The routines at the top (the problem solving ones) are indirected / abstracted from the actual means of solving the problem, making them more flexible to solve the same problem a slightly different way later.
首先我们必须了解添加间接级别的含义。
通常,添加间接级别意味着我们能够提供解决问题的替代方法,最好还具有一些额外的好处。 其他时候,当当前没有任何工作时,间接可能是我们唯一的解决方案。
例如,如果业务需求是“我们需要决定采购多大大小的 IP 块,以便为我们的所有站点提供 IP 寻址”。
问题是,如果我们选择的块太小,那么我们就需要买一个更大的块。 我们的管理员不仅必须获取另一个块,而且现在还必须在我们的路由表中注入额外的前缀才能访问我的站点。 这就需要额外的时间、成本和复杂性。 有没有更好的办法?
如今,IP 地址意味着您登录时的身份以及您所在的位置。
LISP 使用一定程度的间接来解决上述路由问题。
这样做需要一些成本:
现在必须存在一个新的支持 LISP 的服务器来将地址映射到站点
需要两个命名空间(一个用于 以及
一些额外的好处:
添加新块时消除站点重新编号
减少路由表的大小
节省 IPV4 地址空间(未分配给主机的定位器地址空间)
使用 LISP,ISP 可以为每个主机分配更少的地址 使用 LISP ,
下图显示了新的间接层:
LISP 通过添加新层来解决这个问题em>间接并简化了一些事情,但并不完全简单。 它是不同的,并且在很多方面都更好。
First we must understand what Adding Level of Indirection means.
Usually, Adding Level of Indirection means that we are able to provide an alternate way to solve a problem, ideally with some additional benefits. Other times, when nothing is currently working the indirection could be our only solution.
For example if the business need is, "We need to decide what size IP block to procure in order to provide IP addressing to all our sites."
The problem is that if we choose a block that is too small then we will need to get a bigger one. Not only must our administrator go get another block but the now an additional prefixes must be injected in our routing table to access my sites. That's extra time, cost and complexity. Is there a better way?
Today, an IP address means who you are when you login and where you are located.
LISP uses a level of indirection to solve the routing problem stated above.
It does so with some cost:
A new LISP capable server must now exist to map addresses to sites
Two namespaces are required (one for Location the other for ID)
And some additional benefits:
Eliminate the site renumbering when adding a new block
Reduction in size of routing tables
ISP can make changes (moving sites from one host to another)
Conserves IPV4 address space (locator address space not assigned to hosts)
With LISP an ISP can allocate fewer addresses per site
The image below shows the new layer of indirection:
LISP solves the problem by adding a new layer of indirection and simplifies some things, but is not altogether simpler. It's different and in many ways better.
这是一个非常重要的概念,但这里的答案却很少。 一般来说,提出的每个问题不一定可以通过直接代码调整来解决,而是以某种形式应用一些代理(忘记模式定义)。 拦截&| 事件的仪器化被严重低估。
Such a very important concept and so few answers here. Generally every problem presented can be solved not necessarily by direct code adjustments but applying some proxy (forget the pattern definition) in some form. The interception &| instrumentation of events is highly undervalued.
这句话的含义非常广泛。 理解的关键是关注“问题”这个词。 问题可以是编程问题/错误,将世界实体转换为其等效的计算组件,与计算解决方案相关的成本。 假设您正在尝试通过自己开发某些东西的成本来解决问题,您可能需要考虑其他专家来为您完成这项工作,在时间和金钱上要便宜得多。 这是间接的另一种用法
This quote is very broad in its implication. The key to understanding is to focus on the word 'problem'. Problem can be a programming issue/bug, translating a world entity to its equivalent computing component, cost associating with computing solution. Lets say you're trying to solve the issue with cost of developing something yourself, you may want to consider another experts to do the work for you much cheaper in time and money. This is another use of indirection
它源自 Bulter Lampson:
这显然是一句格言,不能按字面意思理解。 这当然不是一个可证明的定理。
It originates from Bulter Lampson:
It is clearly an aphorism and not intended to be taken literally. It is certainly not a provable theorem.