nayaread
HomeFavouritesTopicsSources
HomeFavouritesTopicsSources
NayaRead links to original engineering blogs. All copyright belongs to the respective authors.
Shopify Engineering·Oct 31, 2018·7 min read36

Building Shopify POS for Android Using MVVM - Shopify

There are many architectures out there to structure your app. The one we use in Shopify’s Point of Sale (POS) for Android app is the Model-View-ViewModel (MVVM) pattern based on Google’s App Architecture Guide which was announced last year at Google I/O 2017. Shopify POS History Our POS app is three and a half years old, and we didn’t build it using MVVM from scratch. Before the move to MVVM, we had two competing architectures in our codebase: Model View Controller (MVC) and Model View Presenter (MVP). Both did the job, but they created inconsistency within the codebase. The developers on the team had difficulty switching between the two options, and we didn’t have good answers for questions about which architecture to use when developing new screens and features. The primary advantages for adopting MVVM are consistent architecture, automatic retention of state across configuration changes, and a clearer separation of concerns that lead to easier testing. MVVM helped new members of the team get up to speed during onboarding as they now can find consistent functional examples throughout the codebase and consult the official Android documentation which the team uses as a blueprint. Google is actively maintaining the Android Architecture Components, so we get peace of mind knowing that we’ll continue to reap the benefits as this library is improved.With a significant amount of code using legacy MVC and MVP architectures, we knew we couldn’t make the switch all at once. Instead, the team committed to writing all new screens using MVVM and converting older screens when making significant changes. Though we still have a few screens using MVC and MVP, there isn’t confusion anymore because everyone now knows there is one standard and how to incorporate it into our existing and future codebase. Architecture I’ll explain the basic idea and flow of this architecture by describing the following components of MVVM. Flows in a Model-View-ViewModel Architecture View: View provides an interface for the user to interact

Mobile
Read original on shopify.engineering

Score breakdown

  • Technical depth43
  • Practical value30
  • Originality60
  • Writing quality100
  • Source reputation0
  • Recency0
  • External engagement0
  • On-site engagement0

NayaRead shows a summary and links to the original article. The full article is hosted on shopify.engineering.

More like this

Etsy — Code as Craft

Adopting Jetpack Compose for Etsy’s Android App

John Kalmi·Jan 28, 2025·6 min read
Etsy — Code as Craft

How We Built The Deals Tab in Swift UI

Pierre Rodgers·Mar 5, 2024·13 min read
Shopify Engineering

Five years of React Native at Shopify (2025) - Shopify

Jan 13, 2025·11 min read
Shopify Engineering

Improving Shopify App’s Performance - Shopify

Mar 5, 2024·10 min read