Singletons are the most pragmatic, but most dangerous way of structuring code. They impose static dependencies that can not be mocked during testing and generally lead to confusing implementations (spaghetti code).
In this example MyComponent
has a static dependency on MyService
.