Voiteh / Depin

Dependency injection library for Ceylon
Apache License 2.0
0 stars 0 forks source link

Reduce annotation possibilities for `DependencyAnnotation` and `TargetAnnotation` #30

Closed Voiteh closed 5 years ago

Voiteh commented 5 years ago

Currently class can be annotated with DependencyAnnotation but it don't have to be, to be scanned. This is a bit awkward. The only declarations which should be annotatable by DependencyAnnotation should be value or function declarations. Containers should be automatically included into injection process when needed. So Depin in its costurctor should fetch this container declarations. TargetAnnotation should only be applicable on constructors and is support annotation for selecting which constructor should be used for instantiation. This should include instantiations of dependencies and not only Depin.inject parameters. There is no difference between dependency and target both definitions can be used in different context interchangeable.