Skip to content

Commit

Permalink
Add some background to README
Browse files Browse the repository at this point in the history
  • Loading branch information
dam5s committed Oct 9, 2023
1 parent ce5d1de commit 8109b0c
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@

This is a small cyclic dependency checker for Dart projects.

## Background

Code organization is one of the most common problems we see in frontend applications
(or even backend applications). Ever since the advent of Ruby on Rails, engineers started organizing code by "function
in the framework", for example a `Controller` goes into the `controllers` folder.
The problem with this approach is that it makes the codebase harder to manage / re-structure / re-architecture
over time.

If you ever need to extract a specific feature set, you will have to go all over the codebase to extract it.
It might not even be possible because of tight coupling.

**Tight coupling is introduced by cyclic dependencies.**

This tool assumes that your code is organized by features
instead of "which part of the framework does this match?".
Our [flutter-starter](https://github.com/initialcapacity/flutter-starter) shows an example of code organization
and usage of this tool.

## Setup

From inside one of your Dart projects
Expand All @@ -10,6 +28,8 @@ From inside one of your Dart projects
dart pub add cyclic_dependency_checks --git-url=https://github.com/dam5s/cyclic_dependency_checks.git --git-ref=release/0.2.0
```

`release/0.2.0` here is a tag from [one of the releases](https://github.com/dam5s/cyclic_dependency_checks/releases).

## Running it

Again, from inside your Dart project
Expand All @@ -20,5 +40,6 @@ dart run cyclic_dependency_checks

## Command-Line flags

* `--path` or `-p` for the path to the module that is checked, defaults to current working directory.
* `--path` or `-p` for the path to the module that is checked, path should be a folder containing a `pubspec.yaml`,
defaults to current working directory.
* `--max-depth` or `-d` to limit the depth of the check, defaults to no max depth.

0 comments on commit 8109b0c

Please sign in to comment.