Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Boston NodeJS 7: Dependecy Graphing

Boston NodeJS 7: Dependecy Graphing

Boston NodeJS #7 - Dependency Graphing

Slides - There's a live coding segment - check it at:
https://github.com/WakeskaterX/dependency_graphs

Avatar for WakeskaterX

WakeskaterX

February 07, 2018
Tweet

Other Decks in Programming

Transcript

  1. What is a Dependency Graph? • For this talk: A

    visual representation of the require structure of your application, excluding the node_modules folder. • Purpose: To identify cycles in the graph and to provide a map on how to reorganize. • Why eliminate circular/cyclic dependencies? ◦ Files with cyclic dependencies are harder to test ◦ Inhibit re-use of components ◦ Creates highly coupled code ◦ Leads to messy spaghetti code • Strategies to Eliminate Cycles: ◦ Combine files needing the same resources into one big file ◦ Keep files focused on a single purpose ◦ Break apart a large fille doing too much into smaller files
  2. Introduce: Madge & Graphvis Github: https://github.com/pahen/madge npm i -g madge

    brew install graphvis madge --image /path/to/img.svg ./app.js Madge and graphvis make it very easy to create visual graphs of your service/application.