Question about some strange classes...
urosjarc opened this issue · 4 comments
I don't know if this is a mistake but I want to ask:
- Why are there 2 identical "Mapper" classes in "mobile-UI" and "presentation"?
- What is a purpose of having 3 identical "Buffero" data classes in "domain", "presentation", "mobileUI" and "remote"?
I try to answer your second question.
Buffero class are "identical" only because of simplicity of a sample. Usually your data can have a different representation in different layers. Date/Time data are a best sample for that. You are transporting date as String with Time zone via Network. You store it as a string without time zone in your local DB and have as java DateTime object in domain to be able e.g. simply compare working days. In your UI your are showing e.g. DayOfWeek.
Generally you are pointing to the one of known issues with clean architecture, which tends to looks like overengineered on the first, even on the second look.
Yes, I joust watched Uncle's Bob Single Responsibility Principle, and now I see the logic behind it. Thank you for clarifying it in detail this is much appreciated!
@michalharakal I must say that so far I didn't find such a good project about clean architecture this think is quite a masterpiece. Thank you for open-sourcing this beauty for us 👍
@urosjarc I would like to take credit for that, but @hitherejoe is the author :-) Indeed this is a masterpiece, one from a few I have found with a separated components into gradle modules, as much as possible without dependency on Android.