architecting a complex iphone application
play

Architecting a complex iPhone application Alex Cone - Alpha Geek - - PowerPoint PPT Presentation

CodeFab LLC iPhone Development & Training Architecting a complex iPhone application Alex Cone - Alpha Geek - CodeFab LLC Wednesday, October 7, 2009 1 So Whats The Problem? No Apple examples of full featured applications Books


  1. CodeFab LLC iPhone Development & Training Architecting a complex iPhone application Alex Cone - Alpha Geek - CodeFab LLC Wednesday, October 7, 2009 1

  2. So What’s The Problem? • No Apple examples of full featured applications • Books cover implementation of features, but not architecture • Developers tend to start with examples and evolve - leading to poor architecture CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 2

  3. Application Tasks • First Launch • News Preferences • Location Acquisition • Story Load, Caching CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 3

  4. Application Tasks • Relaunch Update • Recheck Location • Check Data Freshness • Update Data CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 4

  5. Application Tasks • Handle User Activity • Story Reading • Queries • Sharing... • Advertising • Image Caching • Saving State... CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 5

  6. Design Challenge • Application Design • Managing Long Running Tasks • Managing Concurrency • Managing Variable Connectivity • Managing Data • Managing State • Managing Complexity CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 6

  7. Advanced Technology • Singletons • Notifications • Threads • NSOperation/NSOperationQueue CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 7

  8. Singletons • Decoupled Objects • Data Managers • Cache Managers • State Managers • Specialty Controllers (e.g. LaunchController) • NSApplication, NSUserDefaults, etc... CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 8

  9. Singletons UIImage *userPic = [[ImageCache shared] cachedImageForKey:[user name]]; ... + (id)shared { static ImageCache *shared = nil; if(!shared){ shared = [[ImageCache allocWithZone:NULL] init]; } return shared; } CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 9

  10. Notifications • More Object Decoupling • Status Notification • State Change • Pub/Sub Events • NSNotificationCenter CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 10

  11. Notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateHUD:) name:@”TweetStatusNotification” object:nil]; ... - (void) updateHUD:(NSNotification *)notification { if (nil != self.view.window) { NSString *msg = [[notification userInfo] valueForKey:@”Message”]; [[HUDManager shared] showMessage:msg]; } CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 11

  12. Threads • UIKit & Foundation Support • performAfterDelay • Background execution with delegate callback (NSHTTPConnection, etc) • NSThreads, NSOperationQueues CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 12

  13. Process Challenge • Application Development • Managing Development Cycles • Managing Teams • Managing Releases • Testing and QA • Code Reuse CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 13

  14. Advanced Process • Hyper-Agile Methodology • Daily Iterations • Partial Pair Programming • Monthly Releases CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 14

  15. Advanced Process • Code Reuse Strategies • Static Libraries • Overlapping Projects Project Project 2 1 Shared Code CodeFab LLC iPhone Development & Training Wednesday, October 7, 2009 15

  16. CodeFab LLC iPhone Development & Training Q&A Architecting Complex iPhone Applications Alex Cone CodeFab LLC abc@codefab.com Wednesday, October 7, 2009 16

Recommend


More recommend