Answer the question
In order to leave comments, you need to log in
How not to violate the dependency rule?
I'm trying to follow a clean architecture. The domain has the following interface:
interface PostRepository {
save() {};
remove() {};
}
If the database is a SQL database, then all the SQL should be restricted to this layer, and in particular to the parts of this layer that have to do with the database.
Answer the question
In order to leave comments, you need to log in
At the domain level, you only place the interface, there is no dependence on the framework, it's just an interface that you need to implement and use. And at the level of infrastructure already private. If you want to change the ORM or the database, you will only need to implement these interfaces so that nothing changes in the application.
Here is another good article about architecture
https://m.habr.com/en/post/267125/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question