docs: enhance dependency flow explanation in README#13
docs: enhance dependency flow explanation in README#13ahmedshahriar wants to merge 0 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request updates the architecture documentation in the README to more accurately describe the dependency flow between layers in the Domain-Driven Design structure. The update clarifies that model and application both depend directly on domain rather than forming a linear chain.
Key changes:
- Restructured the dependency flow description from a linear chain to a more accurate layered model
- Explicitly lists the dependencies for each layer (
domain,application,model,infrastructure) - Added guidance about avoiding direct dependencies to non-adjacent layers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
README.md
Outdated
| - The `application` layer depends on `domain`. | ||
| - The `model` layer depends on `domain`. | ||
| - The `infrastructure` layer depends directly on `model`, and transitively on `application` and `domain` through `model`. Direct dependencies to non-adjacent layers should be avoided unless absolutely necessary and well-justified. | ||
| This layered approach ensures clean separation and maintainability. For best practices, dependencies should flow through adjacent layers (e.g., infrastructure → model → application → domain) to maintain encapsulation and layer cohesion. |
There was a problem hiding this comment.
The dependency chain example "infrastructure → model → application → domain" is incorrect. According to the documented structure, model depends on domain (line 212), not on application. The actual dependency structure has two parallel paths:
- infrastructure → model → domain
- infrastructure → application → domain
A more accurate example would be: "e.g., infrastructure → {model, application} → domain" or simply remove the specific chain example since line 213 already explains that infrastructure can depend on multiple layers.
| This layered approach ensures clean separation and maintainability. For best practices, dependencies should flow through adjacent layers (e.g., infrastructure → model → application → domain) to maintain encapsulation and layer cohesion. | |
| This layered approach ensures clean separation and maintainability. For best practices, dependencies should flow through adjacent layers (e.g., infrastructure → {model, application} → domain) to maintain encapsulation and layer cohesion. |
README.md
Outdated
| - The `domain` layer is independent. | ||
| - The `application` layer depends on `domain`. | ||
| - The `model` layer depends on `domain`. | ||
| - The `infrastructure` layer depends directly on `model`, and transitively on `application` and `domain` through `model`. Direct dependencies to non-adjacent layers should be avoided unless absolutely necessary and well-justified. |
There was a problem hiding this comment.
The statement that infrastructure depends "transitively on application...through model" is inaccurate. Based on the codebase (e.g., core/infrastructure/inference_pipeline_api.py), infrastructure has direct dependencies on both application and model, not just transitive dependencies through model.
Consider revising to: "The infrastructure layer depends directly on model and application, and transitively on domain through both. Direct dependencies to non-adjacent layers should be avoided unless absolutely necessary and well-justified."
| - The `infrastructure` layer depends directly on `model`, and transitively on `application` and `domain` through `model`. Direct dependencies to non-adjacent layers should be avoided unless absolutely necessary and well-justified. | |
| - The `infrastructure` layer depends directly on both `model` and `application`, and transitively on `domain` through both. Direct dependencies to non-adjacent layers should be avoided unless absolutely necessary and well-justified. |
4a0d877 to
e6f1d1e
Compare
No description provided.