Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-24-2009, 09:35 PM   #18 (permalink)
coondog
Goon (on a good day)
 
Join Date: Apr 2009
Location: California
Posts: 55
Default

Quote:
Originally Posted by eddietr View Post
Yeah, so I can describe something I did in general terms.

So we had a bunch of items on a server that users could view and edit and add to and then we would sync those items back to the server.

So the items are model objects. But those models don't need to know about all the issues with transport over the net (codes as JSON in our case) and nor did they need to know how to deal with failures (phone network disconnects, server is slow, server is down, etc.)

And the models themselves didn't need to deal with the issues of merging updates and changes.

So on both the phone side and the server side, we had these model objects. Which were managed by a controller that exposed what looked like a simple array of those objects. That controller hides all the complexity behind that. That controller also takes care of dumping objects from memory when we're tight for memory, and reconstituting those objects when they are needed again and so on. It hands out proxies to objects when they aren't immediately available so the user interface is always smooth.

Internally the controller knows what to do with inserts and updates and merges and that sort of thing. And that controller uses another controller that deals with the specifics of managing the network and queuing network operations that can't happen at the moment for various reasons, etc.

And then our view controllers just need access to an array of stuff (and be notified when that stuff changes). They don't care about any of those details. They don't care if the objects they are getting are real or proxies. They don't care if those objects are coming from local cache or the network itself.

So we have a single instance of an "array" controller that behaves like a simple mutable array. A pointer to that instance is stored in the app delegate. In turn, that controller uses another controller to send and retrieve actual objects from the server.

There's a little more to it than that, because the controllers have helper objects for certain things. But I hope that at least gives you a high level real world case.
Thank you very much - this helps quite a bit.
coondog is offline   Reply With Quote
 

» Advertisements
» Online Users: 356
20 members and 336 guests
acegames, ADY, apatsufas, BdR, catedawn, Duncan C, georg8betx, Graham, Gurpartap Singh, iph_s, joeallenpro, john love, jorge599, kampftrinker, MarkC, RoryHarvey, sadr1an1, superg, syver
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,876
Threads: 89,225
Posts: 380,699
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jorge599
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.