• Home
  • Manual
  • En
  • Ja
  • En
  • Ja
  • Installation
  • Overview
  • Motivation
  • Getting Started
  • Mental Model
  • Scopes
  • Bindings
  • ・Linked Bindings
  • ・Binding Attributes
  • ・Instance Bindings
  • ・Provider Bindings
  • ・Untargeted Bindings
  • ・Constructor Bindings
  • ・Built-in Bindings
  • ・MultiBindings
  • ・Contextual Bindings
  • ・Null Object Bindings
  • Injections
  • ・Injecting Providers
  • Object Life Cycle
  • AOP
  • Best Practices
  • Graphing Applications
  • Integration
  • Performance
  • Compatibility
  • 1 Page

Ray.Di Best Practices

  • Minimize mutability
  • Inject only direct dependencies
  • Use the Injector as little as possible (preferably only once)
  • Avoid cyclic dependencies
  • Avoid static state
  • Modules should be fast and side-effect free
  • Avoid conditional logic in modules
  • Don’t reuse binding attributes (aka #[Qualifiers])
  • Organize modules by feature, not by class type
  • Document the public bindings provided by modules
© 2011-2025 Ray.Di
  • Github