Note that there are some explanatory texts on larger screens.

plurals
  1. POMVVM Datalayer for Windows 8 app
    primarykey
    data
    text
    <p>This is my first app using MVVM, I'm also using Caliburn.Micro. I've read about MVVM design every day it seems like for the last two weeks. I understand the overall concept but am having difficulty determining how to design the model portion. The reason being is my requirement for data retrieval from a web service.</p> <p>At the most basic level the app flow is as follows: First time running App:</p> <p>Install App -> Search Pharmacy (WebService Call) ->Select Pharmacy (another Web Service Call) -> Create Profile (Web Service Call) -> Main Page of App</p> <p>After first time running:</p> <p>Get Profile(Web Service Call)->Load Pharmacy->Main Page of App</p> <p>So what I end up with (at least for this portion of the app) is: -PharmacyList (List of Pharmacy Objects)</p> <p>-Pharmacy (Object)</p> <p>-Profile (Object containing a SubscriptionsList(List of Pharmacies user has subscribed to) and a Pharmacy object (which is the current pharmacy in the list that sets the context for the app)</p> <p>All of these objects relate to each other at some time or another through various properties of each object. In some cases properties of on object are used as parameters in the webservice call of another object.</p> <p>I have the following views and corresponding view models:</p> <p>Pharmacy Search: (Accepts input used to for the webservice call to populate a list of pharmacy objects.</p> <p>Pharmacy Selection: (allows selection of a pharmacy, the pharmacy objects data is used to make another webservice call to get detailed pharmacy information.)</p> <p>Profile: Allows user to enter profile data and select their current pharmacy or subscribe to another pharmacy (various webservice calls are made here).</p> <p>MainView/View Model: This is the landing page after the user has created a profile and on all subsequent returns to the app this page will load with current pharmacy data and a user profile.</p> <p>There are various other objects, webservices etc from this point on but I just need to get to this point.</p> <p>My question is, how should I structure my models (or more specficaly the data layer). Should I use a DataStore for each object that contains an object defnition and a service class specific to that object to get the JSON data from the API. Or should I create one large Data Store that contains definitions for all object and seperate web service classes to get data? In either approach should I define my models in the Data Store or use the Data Store to get and set models?</p> <p>Currently I'm using a single data store that has an instance of each object and makes a call to a generic web service class. This doesn't seem efficient or modular.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload