Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upLeverage kotlin properties and become independant of the android framework #1
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zsmb13
Oct 10, 2018
Member
This seems like a valid usage of the library, have you ran into an issue while doing this?
|
This seems like a valid usage of the library, have you ran into an issue while doing this? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jmfayard
Oct 10, 2018
I have not used it with Krate specifically but I've used it this pattern a lot with great success in the app I am developping professionally.
There is no reason to depend on the android framework for what is simply a bag of properties.
That's the ideas of ports and adapters. What you need to write your logic is the UserSettings interface (port), you write the adapter for SharedPreferences with Krate and you have a trivial fake implementation for your units tests.
http://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/
jmfayard
commented
Oct 10, 2018
•
|
I have not used it with Krate specifically but I've used it this pattern a lot with great success in the app I am developping professionally. There is no reason to depend on the android framework for what is simply a bag of properties. That's the ideas of http://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
That's a legitimate comment, but it's not an issue. |
jmfayard commentedOct 10, 2018
This stuff should really encourage you to become independant of the android framework and be trivially ready for testing without any mocking non-sense
Usage: