I divided my project into 4 layers
- Show UI layer
- Service layer processing logic
- The domain layer connects to the data source
- Data layer
If the service layer uses classes in the data layer, does it violate the Dependency Inversion principle in SOLID?
Yes, Dependency Inversion requires that your high level modules (like your service layer) is not dependent on low level modules (like your data layer). I think in your case, you should use abstraction (interfaces or abstract classes) that the service layer depends on and the data layer implements.