Composable Code Can Be Simple — Intro to dependency diagrams and composition
In this episode, we continue exploring the dependency inversion principle and composition, while documenting our system’s evolution in diagrams.
- Understand basic depiction of dependencies, abstractions and concrete types in diagrams
- Understand how diagrams translate into code and vice versa
- Understand how the SOLID principles and composition are applied through the examples
- Understand differences and similarities between closures and protocols as abstractions in Swift (unnamed type signatures vs. strictly named types)
Visualizing the dependency graph
Visualizing our code in diagrams can be a great framework to think while modeling the design of our systems. The early visualization of the design can make an excellent tool for communicating ideas to our colleagues and planning/coordinating a team effort. Diagrams can also help with independent development, as the team can quickly plan new features design (5–10 minutes on a whiteboard), build them in parallel and later integrate the pieces without conflicting with the work of other developers.
Moreover, diagrams serve as a great diagnostic tool as they embody the dependency graph of components and modules, revealing tight coupling and even retain cycles that could potentially lead to rigidity and memory leaks. Learning how to draw and read diagrams is an excellent addition in the skillset of developers that aim to create sustainable codebases.
Subscribe now to our Youtube channel and catch free new episodes every week.
Originally published at www.essentialdeveloper.com.
We’ve been helping dedicated developers to get from low paying jobs to high tier roles — sometimes in a matter of weeks! To do so, we continuously run and share free market researches on how to improve your skills with Empathy, Integrity, and Economics in mind. If you want to step up in your career, access now our latest research for free.
If you enjoyed this article, visit us at https://essentialdeveloper.com and get more in-depth tailored content like this.