Hey @jda !
First things first, thank you for taking a look at the Couchbase.Lite.Mapping package!
As you’ve likely noticed, it’s a fairly simple project meant for a singular purpose: converting basic storage objects/models to/from Couchbase Lite objects (i.e. MutableDocument, Document, Result). Essentially, it provides a flexible approach to help reduce the amount of boilerplate code written when mapping your own objects to and from Couchbase Lite objects. It’s purposely generic (no pun intended) to maximize flexibility, not to narrow its scope of use based on architectural requirements. Depending on your exact needs the extension methods provided in Couchbase.Lite.Mapping may not fit your needs, and you’d instead need to map the data in the default manner. That being said, if you see some potential to expand on its current functionality let’s collaborate!
Secondly, you bring up very valid points about the use (and just general confusion) of the MVVM design pattern. If you spend some time digging around you’ll find that people are highly opinionated as to where business and service should live. You’ll find content that recommends keeping business logic within the model, and keeping view models strictly focused on exposing functionality for the view. However, if you throw “services” into the mix you’ll find that business logic can be moved out of both the model and view model, but that’s a whole other “can of worms”. Ultimately, we tend to shy away from recommending one particular architectural approach as your app’s architecture will boil down to your use case where things like code reuse (inter-app, for example), unit/ui testing, etc. will need to be considered.
Some other examples I’d recommend taking at a look are some recent tutorials we’ve created for Xamarin apps:
Please don’t hesitate to give us any and all feedback on the tutorials, as our primary goal is to create the most relevant content we can.
Lastly, because Couchbase.Lite.Mapping isn’t officially supported by Couchbase we’ve opted not to include it in samples like the travel app. However, I agree that providing a more robust example using the mapping component would be useful, and will work on providing one. If you have any app ideas, or functionality you’d like to see included in these samples beyond the use of the mapping Nuget package please let me know!