You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the file interface/repository/user_repository.go, struct userRepository has a direct dependency on gorm.DB which is defined in the outer layer and hence it violates the clean architecture principle.
Thanks for your question. Yes, you're right. Technically, the ORM should be defined as an adapter in order to follow the rule of specific technology separation, but if you feel that it’s too separated, then I think it’s fine to use it as is. Even if you change to another ORM in the future, then you only need to change the code in the repository at that time and you can still keep the dependencies between the usecase and the interface adapters. So, that depends on your team and projects.
In the file
interface/repository/user_repository.go
, structuserRepository
has a direct dependency ongorm.DB
which is defined in the outer layer and hence it violates the clean architecture principle.The text was updated successfully, but these errors were encountered: