Graphics Programs Reference
In-Depth Information
The Need for Stores
Many applications (and especially mobile applications) make use of external sources of
data. External sources of data include web servers, databases, the filesystem, location hard-
ware, the camera, etc. Basically, it's anything that is not already in memory.
If your application interfaces with an external source of data, then Model-View-Controller-
Store is a better approach than Model-View-Controller.
To explain why, first, let's define a term: request logic is code that fetches things from an
external source. Examples of request logic are creating an NSFetchRequest in Core
Data, preparing an NSURLRequest for NSURLConnection , and loading a file with
NSKeyedUnarchiver . Request logic is typically long, complicated, and full of source-
specific details.
In MVC, request logic is the responsibility of controller objects ( Figure 28.1 ). However,
this is not a good solution. Including request logic in a controller muddies up the class and
makes it harder to see how the controller is managing the flow of the application and co-
ordinating the application's model and view objects.
Figure 28.1 Standard MVC
 
Search WWH ::




Custom Search