Another Level of Indirection
In computer programming, indirection/dereferencing is the ability to reference something using a name, reference, or container instead of the value itself. The most common form of indirection is the act of manipulating a value through its memory address.
A famous aphorism of David Wheeler goes:
All problems in computer science can be solved by another level of indirection.
And indeed if you think about it all problems can be made to fit this pattern:
- Customer needs more than one address: Add relation between customer and address.
- Site should display in multiple languages: Add resolution of keys to translated strings by language.
- Content should be displayed in multiple formats: Add selection of format and delegate to that.
- File gets too large: Split into parts and simulate by indirection.
- Need to boot more then an OS: add bootloader which selects OS.
- Need redundant hard discs: Use multiple discs and let RAID controller simulate a redundant one.