Slide 21
Slide 21 text
Motivation
- Goal: Low coupling, high cohesion
- In a unit test, a developer is not interested in arranging a test setup
for a dependency (e.g., an HTTP backend).
- A developer might be interested in switching between different
implementations of a dependency (e.g. a different tax calculation for
Germany and Austria)
- Thus: A component should not arrange its dependencies on its own
but rely on an external party instead (DI container)
- Both .NET and Angular make use of constructor injection
Angular für XAML-Entwickler
DWX Home
Dependency Injection