My touchpad felt laggy and jumpy on my Lenovo Yoga 7 after a week i bought it. It starts with finger rubbing and it is not OS related doesnt go away if i dont press to hard on it to make it contact with something on the body and release the static energy. I opened up the laptop and observed the issue and its grounding problem.
On the left side there is squishy conductor, its almost went deep inside and doesnt make contact with touchpad. I tried poking it with screwdriver to reform to its original shape. This fixed problem but after couple days it looses that squishy form again and problem starts again. I added aluminium foil to right one, i made a bit thicker where it contacts squishy thing so when touchpad screwed in to place it should contact.Dependency Injection
When you have different objects and services that does different things and developed by different teams how do you connect them becomes an issue.
DI is a design pattern that aims to decouple object from their dependencies. Instead of creating their own dependencies internally, object receive them from an external source. By using DI we can configure as needed at runtime; with DI dependencies injected at runtime rather than at compiling.
Dependency injection works together perfectly with SOLID principles.
Single Responsibility Principle - DI can help you isolate responsibility of class.
Open-Closed Principle - With new functionalities we can inject new dependencies instead of changing code base.
Dependency Inversion Principle - Dependencies depend on interfaces instead of concrete classes.
There are three types of DI: Constructor Injection, Setter Injection and Interface Injection.
I will give examples as POJO classes, this pattern can be applied to any language and there are solutions in Spring and .NET.
I will build an awesome(?) music lister that lists your musics from particular artist.