The most efficient iOS app structure

I am developing an iOS application, and I am fixated on how to design it. Here is what I have so far: The application is called "Time Clock", and it allows users to turn the clock on and off. The application will generate timestamps when the user starts or exits accordingly. As for the data, I already have a large MySQL database, which is already in use for a similar Windows desktop. (I'm trying to satisfy my iPhone iPhone users)

My question is: what should I do with the data structures in this application? Can Core Data retrieve and manage MySQL data (via a web service)? Should I use data controller classes to manage data? I do not know how best to process the data.

Here are the data fields that need to be managed:

  • Score
  • Name
  • PIN
  • Time stamp
  • Time stamp

In general, what is the most efficient way to manage data in an application, for example? If you could point me in the right direction, I would be very grateful! :-)

0
source share
1 answer

The main data will not be able to extract anything from the web service, you need to create a data access layer that will return this data to you through NSURLConnection , etc., there is a lot of information on how to do this ... I would recommend modeling some classes that basically your data layer will fill for the rest of your application to work. In addition, if your data is divided in many views, I would suggest creating one singleton class that will save the received data, so you can access it through various UIViewControllers in your application. Way i would structure it

DataAccessLayer (a layer that uses your web services and fills the information in classes (your model)) -> Some Singleton classes that store your objects from your web services -> UIViewControllers (they will talk with your data access level / Singleton class for the data it needs, which, in turn, use it to fill your views → VIEWS → if changes to your model repeater are associated with your web service through the data access level

... As for the master data, you can use this if you want to save the data in your application, but otherwise it is not necessary, I must indicate that the master data is not the only way to save the data in your application ... This The answer is a bit general, but hope it can point you in the right direction ..

Daniel

+3
source

Source: https://habr.com/ru/post/1443321/


All Articles