ソフトウェは抽象化のレイヤーを順番に渡り歩いている

「Chapter 7 Different Layer, Different Abstraction Software systems are composed in layers, where higher layers use the facilities provided by lower layers. In a well-designed system, each layer provides a different abstraction from the layers above and below it; if you follow a single operation as it moves up and down through layers by invoking methods, the abstractions change with each method call. For example: In a file system, the uppermost layer implements a file abstraction. A file consists of a variable-length array of bytes, which can be updated by reading and writing variable-length byte ranges. The next lower layer in the file system implements a cache in memory of fixed-size disk blocks; callers can assume that frequently used blocks will stay in memory where they can be accessed quickly. The lowest layer consists of device drivers, which move blocks between secondary storage devices and memory. In a network transport protocol such as TCP, the abstraction provided by the topmost layer is a stream of bytes delivered reliably from one machine to another. This level is built on a lower level that transmits packets of bounded size between machines on a best-effort basis: most packets will be delivered successfully, but some packets may be lost or delivered out of order. If a system contains adjacent layers with similar abstractions, this is a red flag that suggests a problem with the class decomposition. This chapter discusses situations where this happens, the problems that result, and how to refactor to eliminate the problems.」

—『A Philosophy of Software Design, 2nd Edition』John K. Ousterhout著
https://a.co/27SHz0H

 

 

抽象化ののレイヤーを渡り歩いている

 

同じ抽象度の移動はどこかおかしい

匂いを感じたら対応しよう

 

わかる。

そこ本当にダメかわかっていないけどレイヤーがおかしそう

設計がおかしいし抽象化に失敗してるということなんだろう

 

見つかってからだと結構しんどい