直交性とは影響を与えない設計方法|Orthogonality
記事更新日:2024-01-19
![サムネイル](https://tsukiusagi.biz/wp-content/uploads/2022/01/css.png)
– 直交性 –
垂直で交わらない
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2024/01/640px-Perpendicular-coloured.svg_.png?resize=640%2C443&ssl=1)
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
垂直な線は、どこまでいっても交わらない
In computing, the term has come to signify a kind of independence or decoupling.
pragmatic programmer
コンピューティングでは、この用語は一種の独立または分離を意味するようになりました。
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
コンポーネントを独立させよう
Orthogonalityなコンポーネントにする
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit3.png?resize=150%2C150&ssl=1)
Orthogonalityにするための特徴
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
一つで独立して、自己完結できる
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
独立すると、他人からの影響を排除できる
– Eliminate Effects –
影響を排除する – Eliminate Effects Between Unrelated Things –
Orthogonalityの2つのメリット – two major benefits –
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit3.png?resize=150%2C150&ssl=1)
他人の影響がないと、仕事がはかどる
- increased productivity
- 生産性が増える
- reduced risk
- リスクが減る
1.生産性の向上
- It is easier to write relatively small, self-contained components than a single large block of code.
- 一つの大型ブロックよりも、小さな自己完結型を書くほうが簡単
- An orthogonal approach also promotes reuse.
- 再利用が促進できる
- You get more functionality per unit effort by combining orthogonal components.
- 直交コンポーネントの組み合わせで、さらに機能が作れる
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
書くのが簡単で、再利用できて、組み合わせもできる
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
即効の改善ができる
– an immediate improvement –
2.リスクの低減
- When components are isolated from one another, you know that you can change one without having to worry about the rest.
- 互いに分離されている場合、互いを心配せずに変更できる
- you can be confident that you won’t cause problems that ripple through the entire system.
- システム全体への波紋は広がらないという自信が持てる
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
何も心配しなくていい
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
これぞ、強力な味方
– a powerful way –
直交システムを設計する – orthogonal systems –
Sometimes these components are organized into layers, each providing a level of abstraction. This layered approach is a powerful way to design orthogonal systems.
pragmatic programmer
コンポーネントはレイヤーに編成され、それぞれが抽象化レベルを提供します。この階層化されたアプローチは、直交システムを設計する強力な方法です。
階層化 – layered –
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit3.png?resize=150%2C150&ssl=1)
layer は、「層に分かれている」という意味
たとえば皮膚なら、表皮・真皮・皮下組織の3つの層に分かれている
- 階層化
- 小さな部品に分けること
- 各部品は、独自の機能を持ち、他の部品と独立して動作できる
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
コンポーネントは、それぞれの層の中に配置される
抽象化レベル – a level of abstraction –
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit3.png?resize=150%2C150&ssl=1)
たとえば、「110円」が具体的な支払金額、
「本体価格 + 消費税」の式が抽象化
- 抽象化レベル
- 具体的な詳細を隠す度合い
- 抽象化レベルが高いほど、見た目はシンプル
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
コンポーネントは、抽象化レベルを提供する
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
自分の役割だけを提供し、他人の仕事には口出さない
If I dramatically change the requirements behind a particular function, how many modules are affected?
pragmatic programmer
In an orthogonal system, the answer should be “one.’’
特定の機能の背後にある要件を劇的に変更すると、いくつのモジュールが影響を受けますか?
直交システムでは、答えは「1」であるべきです。
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/01/rabbit1-2.png?resize=150%2C150&ssl=1)
だから設計は難しい
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2022/04/rabbit4-2-1.png?resize=150%2C150&ssl=1)
絶え間ないプロセス
– It’s a Continuous Process –
他人との関係は垂直に
影響は仕事の邪魔
![](https://i0.wp.com/tsukiusagi.biz/wp-content/uploads/2024/01/640px-Perpendicular-coloured.svg_.png?resize=640%2C443&ssl=1)
2024-01-19
編集後記:
この記事の内容がベストではないかもしれません。