Sobes.tech
Junior — Middle

Which SOLID principle is violated when a model depends on a specific implementation of ViewModel?

sobes.tech AI

Answer from AI

The Dependency Inversion Principle from the SOLID set is violated. This principle states that high-level modules should not depend on low-level modules directly, but both should depend on abstractions. If the model depends on a specific implementation of ViewModel, this inversion of dependencies is violated, which reduces the flexibility and testability of the code.