Skip to content

Ideas for Improvements #4

@achimmihca

Description

@achimmihca
  • separate contexts and injectors, introduce dedicated TestContext
  • respect dependencies for injection (e.g. referenced scripts must be injected first)
  • re-binding warning => it should be possible to see where the binding was added

Unclear

  • do DI before Awake?
  • more extensible with custom annotations, e.g. being able to define custom annotation InjectUiAttribute that binds all VisualElement fields of an object by naming convention. UxmlNameAttribute and UssNameAttribute as additional optional annotations to overwrite default behavior.
  • convention over configuration and use additional annotations to specify non-default behavior (more similar to Spring Boot)?
  • ISceneBindingFinishedListener?
  • AddBinding from producer method () => new Stuff()?
  • remove BindToSingleInstanceOfType, because can easily create the instance before
  • fluent API for AddBinding and WithRootVisualElement on Injector (extension methods, get inspiration from Reflex DI https://github.com/gustavopsantos/Reflex )
  • rename methods (CreateChildInjectorWithRootVisualElement, AddBindingForInstance, AddBindingForRootVisualElement) ?
    • Binders vs. BindingBuilder vs. Injector (extension)methods ?
  • RootVisualElementInjectionKey in UniInjectUtils instead of Injector?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions