Architecture as an executable constraint instead of documentation
Guardian Framework treats software architecture as an executable constraint that can be enforced at runtime and build time, rather than just static documentation. It provides a mechanism to define architectural rules that are automatically validated, helping teams maintain architectural integrity as the codebase evolves.
背景メモ
- Guardian Frameworkは、ソフトウェアアーキテクチャのルールをコードとして記述し、実際のプロジェクトコードに対して自動検証を行うツール。
- 従来のアーキテクチャドキュメントは静的で現場の実態と乖離しがちだが、Guardianは「実行可能な制約」として機能し、違反をCI(継続的インテグレーション)で検出する。
- 設計者は「どのレイヤーがどのレイヤーに依存してよいか」などのルールを宣言的に定義。たとえば「ControllerはServiceにのみ依存できる」といった制約を強制できる。
- 類似ツールとしてArchUnit(Java)やLayered Architectureなどがあるが、Guardianは言語非依存(設定ファイルベース)でシンプルな設計を指向している点が特徴。
- 作者のArman Jaliliは、大規模コードベースでArchitecture Erosion(アーキテクチャ劣化)が起きる現実問題に取り組む開発者。