kudoleh / iOS-Clean-Architecture-MVVM

Template iOS app using Clean Architecture and MVVM. Includes DIContainer, FlowCoordinator, DTO, Response Caching and one of the views in SwiftUI
https://tech.olx.com/clean-architecture-and-mvvm-on-ios-c9d167d9f5b3
3.91k stars 672 forks source link

[Question] `Data` package depends on `Networking` package? #31

Open hoangelec opened 12 months ago

hoangelec commented 12 months ago

First of all, thank you for your brilliant work publishing your article and the example source code.

I have a question regarding the diagram in your article, according to your diagram, the dependency direction should be from the "Networking" package to "Data" package

image

However in your example code, Data is depending on Networking, is this a violation of dependency direction?

image
dodomarocgenex commented 12 months ago

The dependency of the network layer on the data repository comes from this method: APIEndpoints.getMovies(with moviesRequestDTO: MoviesRequestDTO)

kudoleh commented 12 months ago

Hello, yes Data Layer Module can dependent on Networking Module. It needs it in order to fetch data from network.