My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Where to fit the Network layer and Offline store management in MVVM architecture?

Radhakrishnan Selvaraj's photo
Radhakrishnan Selvaraj
·Nov 23, 2018

MVVM(Model, View, ViewModel) is considered to be a better architecture than MVC. I map my classes to MVVM as below:

ViewControllers, Views -----> VIEW Model entities ----> MODEL ViewModel of each view ---> VIEW MODEL

Network Calls --- ???? Core data layer --- ???

I have packed the network calls as class functions in a separate class and using it with in ViewController. I find it to be code smell according to MVVM.

How can this be done be better?