8000 Enhance Dependency Injection Documentation with more examples and Application Skeleton · Issue #18387 · cakephp/cakephp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Enhance Dependency Injection Documentation with more examples and Application Skeleton #18387
Open
@jamisonbryant

Description

@jamisonbryant

Description

The Main Idea

Our current dependency injection documentation primarily explains the technical implementation but lacks sufficient explanation of the conceptual benefits and practical applications. The examples given are very high-level (what's a UsersService and how is my app supposed to use it?)

We should significantly expand our DI documentation with more copy-pastable examples and potentially create an application skeleton that demonstrates DI best practices within a CakePHP context.

Potential Roadblocks

  • Finding the right balance between beginner-friendly explanations and advanced usage patterns
  • Adapting existing examples to new framework versions
  • Maintaining additional example code as the framework evolves
  • Ensuring the application skeleton doesn't become overly complex or opinionated
  • Adding more documentation creates more content to maintain with limited contributor resources

User Feedback/Frustration

  • New developers struggle to understand why they should use dependency injection/service-oriented architecture instead of good ol' Tables, Behaviors, and Components
  • Experienced developers lack examples for implementing DI in complex scenarios
  • There are very few (to my knowledge) questions from the community about DI best practices...is anyone using it?
  • Teams migrating from older CakePHP versions find the DI approach conceptually challenging

Potential Next Steps

  1. Enhance the DI docs explaining the benefits (testability, flexibility, separation of concerns)
  2. Develop a progressive series of examples from basic to advanced use cases
  3. Document common patterns for injecting services, repositories, and factories
  4. Create a minimal but complete application skeleton showcasing DI patterns
  5. Add specific examples for testing components with injected dependencies
  6. Consider creating video tutorials demonstrating DI implementation in real-world scenarios - CakeFest?
  7. Poll community to identify the most confusing aspects of DI to address in documentation

CakePHP Version

6

Metadata

Metadata

Assignees

No one assigned

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0