What does the quote "Level of Indirection solves every Problem" mean in Computer Science?
相关问题
- Typescript Interface with function. Subtype as par
- How do I write a function to compare and rank many
- Why does Haskell have non-strict functions (semant
- Using Entity Framework with repository pattern in
- Endianness, “Most Significant”, and “Least Signifi
相关文章
- Get specific values from JSON column in Presto
- Create a java program to solve quadratic equations
- Mysqli abstraction, fetching arrays from prepared
- How do I Modular Design in C?
- Minimum repetitions in merged array of characters
- Why is a monitor implemented in terms of semaphore
- Understanding regex string matching using Dynamic
- Real-world use of binding objects in ruby
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.
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
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.
From the book Beautiful Code:
Although this is contradicted by Wikipedia who attributes the phrase to David Wheeler.
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.
Kevlin Henney's corollary is, "...except for the problem of too many layers of indirection".