sergdort / CleanArchitectureRxSwift

Example of Clean Architecture of iOS app using RxSwift
MIT License
3.9k stars 496 forks source link

Whats the difference between this & Clean-Swift #27

Closed wassimseif closed 6 years ago

wassimseif commented 6 years ago

Hello All I'm new to Clean Architecture, for the last couple of days, I've been struggling with learning the basic concepts of Clean Architecture, For iOS, I have 2 main sources for learning, This repo & Raymond's implementation here. These 2 implementations differ in the concepts of clean architecture. 1- one example is that this implementation relies on a Domain target to store all the models for the app, All the targets that want to use one of these models has to import Domain to see them. 2- Another example is that Raymond's implementation relies on workers to do the actual work of the interactor, why doesn't this repo make use of these workers to push the Single Responsibility Principle further?

Any help is highly appreciated!

sergdort commented 6 years ago

Hi @wassimseif ! Regarding 1 I can say that the purpose of Domain is to define interface and data objects that represent the problem we are trying to solve in our app , from implementation details.. E.g for example the way we persist data is implementation detail. UI is implementation detail as well.( as for example what if at some point you would want creat desktop app, or TV app, or Android app). One of my former colleagues once implemented terminal app based on our domain, as prove of concept.

Regarding 2 I’m not sure what is workers if you point me to the implementation may be I’ll be able to explain :)

wassimseif commented 6 years ago

Hello @sergdort Thank you for your help! This is the explanation/implementation of the worker i'm talking about. https://clean-swift.com/clean-swift-tdd-part-3-worker/

sergdort commented 6 years ago

TBH not still not sure what is the purpose of the Workers but it seems to be pretty close to Repository pattern ¯_(ツ)_/¯.

sergdort commented 6 years ago

Feel free to reopen if you have any questions