4 ms·
I don't get it. If you're sharing logic across web and mobile doesn't that demand moving as much work as possible to the server? I've built a plenty of web and
by tootie 6y ago
I don't get it. If you're sharing logic across web and mobile doesn't that demand moving as much work as possible to the server? I've built a plenty of web and mobile apps and that's how I've always done it. Maybe I'm not thinking of the kind of tasks you're talking about. Can you give an example of what kind of process would need to be run on device that's independent of UI?
- mdpye 6y agoGiving a good experience with poor connectivity means the clients need to be able to reason about updates to the domain model and potential conflicts. At this point they need to reason about almost as much as the server. Search for "offline first" to see how people are exploring architectures like this. Edit: source: I worked on a product bundling chat functionality as a plug in. In fairness, I think this is not so relevant for apps which are consumption first, but if there's any kind of collaboration, or even just writing from the client, you want to show an optimistic (at least; some systems make the client state canonical) representation regardless of sync status.
- bluepizza 6y agoAuthentication and identity management comes to mind immediately. But, of course, there are plenty apps that prefer to do things locally, for so many reasons - if Spotify downloads songs, it does so locally. Or a note taking app such as Evernote needs to capture and compress whatever was drawn on the screen. Not to mention games! If you think about more than CRUD apps, you’ll see that there are plenty things to be run on the device which are independent of UI.
- filleokus 6y agoSome use cases I think about off the top of my head: - Data model operations on local copy of data: For some use cases you can't just send everything to the server all the time, instead you want a local representation which is periodically synced with the server - Logging / monitoring: Expose a single logging / monitoring API which can be shared across platforms - Input validation / rules engine: Consider implementing a syntax highlighter, you wouldn't want to do that on the backend. Even simple form validation might sometimes be preferable to do client side, calling the multiplatform validate(data_model) and getting per-field validation back would allow for a lot of logic re-use. - Do work that could be done on the server: Because of a lot of factors, like privacy or cost you might want to do work that could be done on the server. I.e, calling some sensitive third party API (banking?) where you have to transform requests/responses. Or maybe computation on large sets of data (video compression?) which otherwise would need to be sent to the backend. - Interact with devices only locally accessible: IoT/bluetooth things
- vbezhenar 6y agoIf you're moving most of logic to the server, why have an app at all? Just build a website. For me app means offline work.
- snappytrap 6y agoMobile apps often achieve better conversion rates than mobile websites - at least for e-commerce.
- fomine3 6y agoIf it's only the reason why build app, it looks like providing WebView wrapper based app is just fine.
- setr 6y agoYou end up duplicating the logic achieve to offline-first, and reduce network roundtrips. Eg your sign up page final validation is probably the server's job, but if you want to give earlier/faster failure messages, you'll want it on the frontend too. Server authoratative validation is security; frontend validation is UX