On Thursday, January 1, 2015 4:36:53 PM UTC-3, Jens Alfke wrote: > > > > On Dec 30, 2014, at 10:11 AM, Federico Hernandez <[email protected] > <javascript:>> wrote: > > > > Now, our doubt is that if we wanted to add a new business rule (a new > functionality) to the web service, we should replicate the functionality in > the mobile app, or if we had to add a business rule in the mobile app, we > should replicate the functionality in the web service. Is there a better > way to do that to avoid replicating code? > > It depends on the details. But often, yes, you'll need two > implementations, because effectively you have client apps on two different > platforms (mobile and web.) And you can't have the mobile app call through > to the web implementation because that would create a direct dependency on > the network, so the mobile app wouldn't be able to work offline. > > If the new logic can be implemented entirely in the back end, without > affecting the UI or data validation, then you might be able to implement it > as a server-side task that watches changes to the Sync Gateway database. > Then neither client needs to be updated. For instance this could be > something that notices a specific property being added to a document, and > creates some new document in response. >
Thank you Jens for the answer. -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/d61a4e85-0bcb-46d3-aa4d-329bf3714b96%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
