Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce domain module #47

Merged
merged 8 commits into from
Jul 27, 2021
Merged

Introduce domain module #47

merged 8 commits into from
Jul 27, 2021

Conversation

wzieba
Copy link
Contributor

@wzieba wzieba commented Jul 26, 2021

@anitaa1990 this change changes some classes which are a domain for #34. Sorry for that! Please feel free to not merge this PR for now until your changes will land and then I'll resolve conflicts. I create this PR to gather early feedback.

Decision log

Why modularize now?

Using modules we can work on this library effectively, part by part. After encapsulating domain-related classes into a separate module, I was able to compile it and even run tests:

image

We can also run static code analysis:

./gradlew :MediaPicker:domain:test :MediaPicker:domain:ktlint

So we are sure that domain part is correct.

Why changes related to UiString and Uri/UriWrapper?

The MediaLoader in its origin has a dependency to the presentation layer: it uses UiString (which covers a UI logic). Also MediaItem, a domain model, has dependency to android.net.Uri. As suggested architecture follows Clean Architecture principles, we should keep our domain module platform-agnostic. This is why I've decided to remove UiString and change how we work with Uris - now with value class wrapper on it in domain module.

Closes: #44
Closes: #31

Copy link
Contributor

@anitaa1990 anitaa1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @wzieba! These changes look good. Would it be ok to merge it after #48? I will be working on the MediaPickerFragment next and will use the changes from this PR as a starting point for that 👍

@wzieba
Copy link
Contributor Author

wzieba commented Jul 27, 2021

Thanks @anitaa1990 !

Would it be ok to merge it after #48?

Sure thing, I'll merge #48 first!

@wzieba
Copy link
Contributor Author

wzieba commented Jul 27, 2021

@anitaa1990 I'm surprised but there's conflicts! 😄 I'm merging this PR then so we can have clean state to work on next PRs

@wzieba wzieba merged commit 784c7ad into trunk Jul 27, 2021
@wzieba wzieba deleted the issue/44_extract_domain_module branch July 27, 2021 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract domain module Decide if we want to use UiString.
2 participants