|
| 1 | ++++ |
| 2 | +title = "Different Types Of Decoupling" |
| 3 | +date = 2022-10-23 |
| 4 | +updated = 2023-02-03 |
| 5 | +[taxonomies] |
| 6 | +tag = ["posts"] |
| 7 | ++++ |
| 8 | + |
| 9 | +> The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on |
| 10 | +> a uniform interface between components. By applying the software engineering principle of generality to the component |
| 11 | +> interface, the overall system architecture is simplified and the visibility of interactions is improved. |
| 12 | +> Implementations are decoupled from the services they provide, which encourages independent evolvability. |
| 13 | +
|
| 14 | +_-Roy Fielding, <https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm#sec_5_1_5>_ |
| 15 | + |
| 16 | +Decoupling is the opposite of [coupling](https://en.wikipedia.org/wiki/Coupling_(computer_programming)), where two |
| 17 | +pieces of software have a high degree of _interdependence_. Decoupling software is the act of reducing this |
| 18 | +interdependence between unrelated modules so that they can evolve independently. The concept of coupling and decoupling |
| 19 | +is closely (and inversely) related to [cohesion](https://en.wikipedia.org/wiki/Cohesion_(computer_science)). A highly |
| 20 | +cohesive software module has related logic within a module or conceptual boundary, rather than spread out. Broadly, |
| 21 | +the more decoupled your codebase is, the more cohesive it will be as well. Developers generally have a sense that |
| 22 | +decoupling is a good thing |
| 23 | + |
| 24 | +An argument we see at times for the JSON/Data API style of development, where a Single Page Application-style web |
| 25 | +applications communicates with a back end via a JSON API, is that this architectural choice _decouples_ the front-end and |
| 26 | +back-end code, and allows re-use of the JSON API in other contexts, such as a mobile application. |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | +You can imagine how creating a general JSON Data API that can be consumed by multiple clients would _decouple_ your |
| 31 | +application's back-end code from a particular client: it provides a standard, well documented API and any client that wants |
| 32 | +to can use that is welcome to do so. |
| 33 | + |
| 34 | +In the second part of this essay we are going to talk about the hypermedia approach, and how it decouples your system in |
| 35 | +a different manner than the way a generic Data API does. But, before we get into that, we want to spend a bit of time and |
| 36 | +look at the facts on the ground with respect to JSON APIs and see how decoupling is working out. |
| 37 | + |
| 38 | +## "The Worst Part Of My Job..." |
0 commit comments