Dependency Direction for Shared Business Rules

A shared rule can live where different interfaces use it without requiring that rule to import a particular user interface.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a capacity check
  2. Check dependency cycles

Trace a capacity check

A command-line importer and a web form can both require a positive capacity. A small shared rule can accept the parsed quantity and report a result. See composing validators.

Check dependency cycles

If the rule imports a web view that itself imports the rule, startup can depend on order. Module cycles illustrate why placing stable contracts independently helps.[1]

References

  1. David L. Parnas, On the Criteria to Be Used in Decomposing Systems into Modules, CMU-CS-71-101 ↩