The current codebase is a bit difficult to work with in my opinion. Unit testing is especially difficult and it doesnt seem like a testable design architecture is being used. There are about a gazillion different architectures and patterns out there and while I have by no means tested them all I find that MVP is easy to understand and test. Additionally, you could consider something like the repository pattern for easier API development.
I'll be happy to create PR with a proposed MVP example. I havent been able to find the easiest place to start as it's pretty time consuming trying to wrap my head around the various bits and pieces related to an isolated activity and/or view.
Migrating to a cleaner architecture means we can actually write effective unit tests for the application. MVP would make it trivial to write unit tests for the presenter and instrumented tests for the view for full code coverage.
Sounds awesome @ardevd
About using MVP I am not 100% sure yet. What I would like to do/support/work on is making use of the Android Architecture components, Room, etc. The Architecture components can be used with MVP I'd and MVVM.
So I'd say I am fine either way, so just not sure which of the two variants to choose.
Google provides examples for both: https://github.com/googlesamples/android-architecture-components
Any opinion @mario @tobiasKaminsky ? Is Nextcloud talk using any of the two?
Really, as long as it's possible to test I dont care if its MVP, MVVM, MVP, etc, though MVP is the only design pattern I have extensive experience with. I do feel MVP is easier to migrate to than MVVM on Android since it was only just recently at all possible to do a somewhat clean MVVM implementation on Android with native data bindings.
Anyways, it's up to you guys, but I do strongly recommend moving away from whatever it is you have currently :)
Anyways, it's up to you guys, but I do strongly recommend moving away from whatever it is you have currently :)
Fully agree and architecture wise we are having atm: nothing (since it is a fork and we never took/found the time to refactor)
@mario @tobiasKaminsky what do you think? I'd be fine with MVP since @ardevd would like to work on it and has the experience with that approach :)
I also searched for quite some time and read a lot.
Personally I feel a bit more into MVP.
To get a feeling how this will be, and as it is not that big, I suggest to start with activities. (This will get merged at some point with notifications...).
I would be really glad if you wanna give this a start @ardevd :+1: :tada:
Starting with the activities activity sounds like a good starting point to me to since that activity is quite isolated from the others so that should be easier to move :+1:
Any comment @mario?
@tobiasKaminsky I'll look into it and see what I can work out :) no promises though.
@AndyScherzinger The Activities activity sounds like a good starting point. I'll probably try to just refactor the entire thing if you guys dont mind. I'll give it a go and see what I can come up with :)
Well, MVP is so-so, but anything is better than what we currently have. So completely for it! 馃憤
@ardevd whatever works best for you. Beware that this might produce a lot of merge issues with existing PRs or any rebase when the mater is progressing during the refactoring.
@AndyScherzinger Hah, thanks for the warning. I'll try to keep breakage as small as possible :) I'll give an update once I've taken a look a closer look at how the Activities activity (wow, what a mouth full) is put together.
@ardevd sounds like a plan! Really looking forward to it!
Merge conflicts should be not that much, if "only" activity stuff is touched.
As always, we are here to help, also on IRC :-)
Most helpful comment
@AndyScherzinger Hah, thanks for the warning. I'll try to keep breakage as small as possible :) I'll give an update once I've taken a look a closer look at how the Activities activity (wow, what a mouth full) is put together.