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

architecting a complex iphone application
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

CodeFab LLC

iPhone Development & Training

Architecting a complex iPhone application

Alex Cone - Alpha Geek - CodeFab LLC

1 Wednesday, October 7, 2009

slide-2
SLIDE 2

CodeFab LLC

iPhone Development & Training

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

2 Wednesday, October 7, 2009

slide-3
SLIDE 3

CodeFab LLC

iPhone Development & Training

Application Tasks

  • First Launch
  • News Preferences
  • Location Acquisition
  • Story Load, Caching

3 Wednesday, October 7, 2009

slide-4
SLIDE 4

CodeFab LLC

iPhone Development & Training

Application Tasks

  • Relaunch Update
  • Recheck Location
  • Check Data Freshness
  • Update Data

4 Wednesday, October 7, 2009

slide-5
SLIDE 5

CodeFab LLC

iPhone Development & Training

Application Tasks

  • Handle User Activity
  • Story Reading
  • Queries
  • Sharing...
  • Advertising
  • Image Caching
  • Saving State...

5 Wednesday, October 7, 2009

slide-6
SLIDE 6

CodeFab LLC

iPhone Development & Training

Design Challenge

  • Application Design
  • Managing Long Running Tasks
  • Managing Concurrency
  • Managing

Variable Connectivity

  • Managing Data
  • Managing State
  • Managing Complexity

6 Wednesday, October 7, 2009

slide-7
SLIDE 7

CodeFab LLC

iPhone Development & Training

Advanced Technology

  • Singletons
  • Notifications
  • Threads
  • NSOperation/NSOperationQueue

7 Wednesday, October 7, 2009

slide-8
SLIDE 8

CodeFab LLC

iPhone Development & Training

Singletons

  • Decoupled Objects
  • Data Managers
  • Cache Managers
  • State Managers
  • Specialty Controllers (e.g. LaunchController)
  • NSApplication, NSUserDefaults, etc...

8 Wednesday, October 7, 2009

slide-9
SLIDE 9

CodeFab LLC

iPhone Development & Training

Singletons

UIImage *userPic = [[ImageCache shared] cachedImageForKey:[user name]]; ... + (id)shared { static ImageCache *shared = nil; if(!shared){ shared = [[ImageCache allocWithZone:NULL] init]; } return shared; }

9 Wednesday, October 7, 2009

slide-10
SLIDE 10

CodeFab LLC

iPhone Development & Training

Notifications

  • More Object Decoupling
  • Status Notification
  • State Change
  • Pub/Sub Events
  • NSNotificationCenter

10 Wednesday, October 7, 2009

slide-11
SLIDE 11

CodeFab LLC

iPhone Development & Training

Notifications

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateHUD:) name:@”TweetStatusNotification”

  • bject:nil];

...

  • (void) updateHUD:(NSNotification *)notification {

if (nil != self.view.window) { NSString *msg = [[notification userInfo] valueForKey:@”Message”]; [[HUDManager shared] showMessage:msg]; }

11 Wednesday, October 7, 2009

slide-12
SLIDE 12

CodeFab LLC

iPhone Development & Training

Threads

  • UIKit & Foundation Support
  • performAfterDelay
  • Background execution with delegate

callback (NSHTTPConnection, etc)

  • NSThreads, NSOperationQueues

12 Wednesday, October 7, 2009

slide-13
SLIDE 13

CodeFab LLC

iPhone Development & Training

Process Challenge

  • Application Development
  • Managing Development Cycles
  • Managing Teams
  • Managing Releases
  • Testing and QA
  • Code Reuse

13 Wednesday, October 7, 2009

slide-14
SLIDE 14

CodeFab LLC

iPhone Development & Training

Advanced Process

  • Hyper-Agile Methodology
  • Daily Iterations
  • Partial Pair Programming
  • Monthly Releases

14 Wednesday, October 7, 2009

slide-15
SLIDE 15

CodeFab LLC

iPhone Development & Training

Advanced Process

  • Code Reuse Strategies
  • Static Libraries
  • Overlapping Projects

Shared Code Project 2 Project 1

15 Wednesday, October 7, 2009

slide-16
SLIDE 16

Q&A

CodeFab LLC

iPhone Development & Training

Architecting Complex iPhone Applications

Alex Cone

CodeFab LLC abc@codefab.com

16 Wednesday, October 7, 2009