SlideShare a Scribd company logo
Design Patterns For Distributed
Mobile Applications




                                 Jason H Christensen
                 Intelligence In Motion Partners, LLC
               iPhone Developer Summit West, 2009
What We’ll Cover



    Why Distributed Mobile Patterns

    Simple REST Consumer

    Authenticated REST Consumer

    Key Handling Pattern

    XMPP Coordinator Stream Pattern

    Remote Invocation Push Response Pattern
Enterprise Mobile Architectures Timeline
Why Distributed Mobile Architectures

Corporateers are leaving their laptops at their desk.

iPhone in the Enterprise has made some noise, but
  Blackberry is entrenched due to existing apps.

iPhone has to create key advantages to become more
  competitive in the enterprise space.

iPhone has some key disadvantages, limited carrier
  options, new programming language, “data walking
  off”
Which Distributed Mobile Architectures


Some key areas to target for Mobile Enterprise
  Applications
             Sales Force/Remote Management
              Sales, Store Mgr, Distribution
             Executive Information Systems
              Dashboard and Alerts
             Workflow Engagement
              Legal, Purchasing, Receiving
             Customer Issue Resolution
              Escalations/Technical Support
Enter Distributed Mobile Patterns

The First Five Distributed Mobile Patterns address
 some hot button current enterprise features:
             Connecting to internal services
              Simple REST Consumer
             Connecting to cloud
              Secure Key Handling Pattern
              Authenticated REST Consumer
             Workflow Integration
              Remote Invocation/Push Response
              XMPP Coordinator Stream Pattern
Simple REST Consumer Pattern

Intent
To provide a quick and easy mobile REST implementation
Motivation:
There are numerous requests where we create a proof of concept.
  The motivation is to keep the client and server as simple as
  possible to show we can deliver on the crux of a given need.
Consequences:
Ideal for getting a RESTful system setup quickly, but…

  Does not handle custom headers, or authentication

  Trivial Systems only, Systems that contain sensitive functionality
  or information should use the “Authenticated REST Consumer”
  pattern.
Simple REST Consumer(iPhone)

                                        KeyStrings
     enum ExpectedTags              +kElementName1,…

                                              From didStartElement:
          SimpleRESTCall                             if(currentElement == kElementName){
 -initWithFormattedURL:(NSString*)fUrl                    currentTag = enumForThatTag;
 andParameters:(NSDictionary*)params
                                                     }
- parser:didStartElement:
- parser:didEndElement:
- parser:foundCharacters:
- (NSObject*)getData




             MyRESTCall


                                 Concrete Consumer
Authenticated REST Consumer Pattern

Intent
To provide a common framework for federated identity RESTful
  services.
Motivation:
This pattern is used in systems that require manipulation of the
  “Authorization” request header, based on headers. Eg:
  
      Amazon AWS based invocations,
  
      OAUTH invocations, and custom implementations

Consequences:
This is a generalized pattern, most systems use similar methods, but
  the header combination or method for acquiring the token may
  differ. To handle this, TokenManager and StringToSign are
  implementation specific.
Authenticated REST Consumer(iPhone)

   enum ExpectedTags                             AuthTokenGenerator
                                          - TokenManager* request
       KeyStrings                         - StringToSign* signatureString
   +kElementName1,…                       -initWithRequest:(NSURLRequest*)fUrl;
                                          - (NSString*)getAuthString
      AuthenticatedRESTCall
- NSMutableURLRequest* request
- NSHTTPURLResponse* response
-AuthTokenGenerator* authTokenGen;

-initWithFormattedURL:(NSString*)fUrl   TokenManager                   StringToSign
andParameters:(NSDictionary*)params                              -initWithRequest:
- parser:didStartElement:                                             (NSURLRequest*)fURL
- parser:didEndElement:
- parser:foundCharacters:
- (NSObject*)getData
                                         AuthSpecific                  AuthSpecific
                                          TokenMgr                     StringToSign


    MyAuthenticatedRESTCall
Lightweight Network Status Monitor

Intent:
Provide a lightweight status mechanism to all applications in a
  standard fashion
Motivation:
A mobile application can have a number of connection types, not
  connected, keeping note of this status allows communication to
  the user when connectivity changes.
Consequences:
This is a very simple pattern, and probably could be implemented
  inline just as easily. The goal of this pattern is the use of a
  delegate pattern to notify application when statuses change.
Lightweight Network Status Pattern
             enum
         ConnectionType                            LwNetStatusDelegate
                                            -notify:(enum ConnectionType) presentType;


        NetworkStatusMonitor
- ConnectionType* ct
- NSArray* delegates
-checkNetStatusAndTypeFor:(NSString*) net
- notifyDelegates

                                                        AppDelegate
Remote Invocation Push Resopnse

Intent
To provide notifications from workflow systems to a mobile user
Motivation:
Needed to provide a workflow step an acknowledgement, response,
  or notification.
Push notification is more resilient for verifications, app can close or
  be interrupted and the push will still be received.
Consequences:
There is additional cost and security considerations with this over a
  traditional email response. Email is a valid alternative, but does
  not notify the user directly.
Remote Invocation/Push Response (iPhone)

iPhone Application        sendDeviceToken   Web Application
   initPushFunctions                        newDeviceListener

                           HTTP Request
AuthenticatedRESTAsynch


                          HTTP Response
                                                ServerListener


                                                       QueueRequest


                                               ProcessingQueue
Remote Invocation/Push Response (iPhone)

iPhone Application                               Web Application

                                                     ServerProcess

                                                             Processing
                                                             Complete
didFinishLaunchingWithOptions   sendResponseID
                                                 pushBinaryResponse
didReceiveRemoteNotification


                                 HTTP Request
AuthenticatedRESTPayload

                                HTTP Response
                                                     ServerListener
XMPP Coordinator Stream Pattern


Intent
Utilize a standard messaging protocol as a baseline for higher level
  messaging functionality
Motivation:
This was kind of a eureka moment, but we were stuck trying to find
  a way to bridge between J2EE based MOM and our Mobile Apps.
  We decided to create a listener on the XMPP port and to use that
  to bridge with the phone.
Consequences:
There is additional cost and security considerations with this over a
  traditional email response. Email is a valued alternative, but does
  not notify the user directly.
XMPP Coordinator Stream Pattern

 iPhone                                  XMPP
                     presence:
Application            show              Server
  initXMPP                           xmppListener
                     group invite    xmppListener
  Group::init        rsrc1@coordsvr
                     Group:<coordid>

Activity::Enlist      CoordMsg       xmppListener


Activity::Perform      CheckStatus   xmppListener


Activity::Complete      Close        xmppListener
XMPP Coordinator Notes



    Each resource enlists on it’s own

    We create a group for a set of resources

    Messages and responses are sent to the
    group

    Any phase can fail causing a compelete
    failure
    
        Since group, all failures are seen by each resource
Distributed Mobile Design Patterns




    What we covered:
             Enterprise Mobile History
             What spaces are hot for enterprise mobile
             Five patterns for Mobile App enablement
              XMPP Coordinator Stream
              Remote Invocation/Push Response
              Lightweight Network Status
              Authenticated REST Requests
              Simple REST Request
Questions?




    Feel free to contact me:
        Jason H Christensen
        jason_h_christensen@jasonc411.com
        Slideshare: jasonc411
        Twitter: jasonc411
        http://jasonc411.com

More Related Content

Similar to iPhone Developer Summit West

Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
Dr. Fahad Aijaz
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
VMware Tanzu
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
InnoTech
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
João Pedro Martins
 
PDC Highlights
PDC HighlightsPDC Highlights
PDC Highlights
MS Innovation Days
 
Android workshop
Android workshopAndroid workshop
Android workshop
Nikola Kapraljevic Nixa
 
Inside Logic Apps
Inside Logic AppsInside Logic Apps
Inside Logic Apps
BizTalk360
 
Web Service
Web ServiceWeb Service
Web Service
Ashwani kumar
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go Bad
Steve Loughran
 
WCF
WCFWCF
Elefrant [ng-Poznan]
Elefrant [ng-Poznan]Elefrant [ng-Poznan]
Elefrant [ng-Poznan]
Marcos Latorre
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Rajesh Ramasamy
Rajesh RamasamyRajesh Ramasamy
Rajesh Ramasamy
Rajesh Ramasamy
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
Lalit Kale
 
SOA patterns
SOA patterns SOA patterns
SOA patterns
Arnon Rotem-Gal-Oz
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
Sujee Maniyam
 
Windows 8 BootCamp
Windows 8 BootCampWindows 8 BootCamp
Windows 8 BootCamp
Einar Ingebrigtsen
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
Droidcon Eastern Europe
 
PeopleSoft: HACK THE Planet^W university
PeopleSoft: HACK THE  Planet^W universityPeopleSoft: HACK THE  Planet^W university
PeopleSoft: HACK THE Planet^W university
Dmitry Iudin
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
gturnquist
 

Similar to iPhone Developer Summit West (20)

Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services: Asynchronous Mobile Web Services:
Asynchronous Mobile Web Services:
 
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
Winning the Lottery with Spring: A Microservices Case Study for the Dutch Lot...
 
Rest API and Client OM for Developer
Rest API and Client OM for DeveloperRest API and Client OM for Developer
Rest API and Client OM for Developer
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
 
PDC Highlights
PDC HighlightsPDC Highlights
PDC Highlights
 
Android workshop
Android workshopAndroid workshop
Android workshop
 
Inside Logic Apps
Inside Logic AppsInside Logic Apps
Inside Logic Apps
 
Web Service
Web ServiceWeb Service
Web Service
 
When Web Services Go Bad
When Web Services Go BadWhen Web Services Go Bad
When Web Services Go Bad
 
WCF
WCFWCF
WCF
 
Elefrant [ng-Poznan]
Elefrant [ng-Poznan]Elefrant [ng-Poznan]
Elefrant [ng-Poznan]
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
Rajesh Ramasamy
Rajesh RamasamyRajesh Ramasamy
Rajesh Ramasamy
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
SOA patterns
SOA patterns SOA patterns
SOA patterns
 
Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)Iphone client-server app with Rails backend (v3)
Iphone client-server app with Rails backend (v3)
 
Windows 8 BootCamp
Windows 8 BootCampWindows 8 BootCamp
Windows 8 BootCamp
 
Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012Android rest client applications-services approach @Droidcon Bucharest 2012
Android rest client applications-services approach @Droidcon Bucharest 2012
 
PeopleSoft: HACK THE Planet^W university
PeopleSoft: HACK THE  Planet^W universityPeopleSoft: HACK THE  Planet^W university
PeopleSoft: HACK THE Planet^W university
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 

iPhone Developer Summit West

  • 1. Design Patterns For Distributed Mobile Applications Jason H Christensen Intelligence In Motion Partners, LLC iPhone Developer Summit West, 2009
  • 2. What We’ll Cover  Why Distributed Mobile Patterns  Simple REST Consumer  Authenticated REST Consumer  Key Handling Pattern  XMPP Coordinator Stream Pattern  Remote Invocation Push Response Pattern
  • 4. Why Distributed Mobile Architectures Corporateers are leaving their laptops at their desk. iPhone in the Enterprise has made some noise, but Blackberry is entrenched due to existing apps. iPhone has to create key advantages to become more competitive in the enterprise space. iPhone has some key disadvantages, limited carrier options, new programming language, “data walking off”
  • 5. Which Distributed Mobile Architectures Some key areas to target for Mobile Enterprise Applications  Sales Force/Remote Management  Sales, Store Mgr, Distribution  Executive Information Systems  Dashboard and Alerts  Workflow Engagement  Legal, Purchasing, Receiving  Customer Issue Resolution  Escalations/Technical Support
  • 6. Enter Distributed Mobile Patterns The First Five Distributed Mobile Patterns address some hot button current enterprise features:  Connecting to internal services  Simple REST Consumer  Connecting to cloud  Secure Key Handling Pattern  Authenticated REST Consumer  Workflow Integration  Remote Invocation/Push Response  XMPP Coordinator Stream Pattern
  • 7. Simple REST Consumer Pattern Intent To provide a quick and easy mobile REST implementation Motivation: There are numerous requests where we create a proof of concept. The motivation is to keep the client and server as simple as possible to show we can deliver on the crux of a given need. Consequences: Ideal for getting a RESTful system setup quickly, but…  Does not handle custom headers, or authentication  Trivial Systems only, Systems that contain sensitive functionality or information should use the “Authenticated REST Consumer” pattern.
  • 8. Simple REST Consumer(iPhone) KeyStrings enum ExpectedTags +kElementName1,… From didStartElement: SimpleRESTCall if(currentElement == kElementName){ -initWithFormattedURL:(NSString*)fUrl currentTag = enumForThatTag; andParameters:(NSDictionary*)params } - parser:didStartElement: - parser:didEndElement: - parser:foundCharacters: - (NSObject*)getData MyRESTCall Concrete Consumer
  • 9. Authenticated REST Consumer Pattern Intent To provide a common framework for federated identity RESTful services. Motivation: This pattern is used in systems that require manipulation of the “Authorization” request header, based on headers. Eg:  Amazon AWS based invocations,  OAUTH invocations, and custom implementations Consequences: This is a generalized pattern, most systems use similar methods, but the header combination or method for acquiring the token may differ. To handle this, TokenManager and StringToSign are implementation specific.
  • 10. Authenticated REST Consumer(iPhone) enum ExpectedTags AuthTokenGenerator - TokenManager* request KeyStrings - StringToSign* signatureString +kElementName1,… -initWithRequest:(NSURLRequest*)fUrl; - (NSString*)getAuthString AuthenticatedRESTCall - NSMutableURLRequest* request - NSHTTPURLResponse* response -AuthTokenGenerator* authTokenGen; -initWithFormattedURL:(NSString*)fUrl TokenManager StringToSign andParameters:(NSDictionary*)params -initWithRequest: - parser:didStartElement: (NSURLRequest*)fURL - parser:didEndElement: - parser:foundCharacters: - (NSObject*)getData AuthSpecific AuthSpecific TokenMgr StringToSign MyAuthenticatedRESTCall
  • 11. Lightweight Network Status Monitor Intent: Provide a lightweight status mechanism to all applications in a standard fashion Motivation: A mobile application can have a number of connection types, not connected, keeping note of this status allows communication to the user when connectivity changes. Consequences: This is a very simple pattern, and probably could be implemented inline just as easily. The goal of this pattern is the use of a delegate pattern to notify application when statuses change.
  • 12. Lightweight Network Status Pattern enum ConnectionType LwNetStatusDelegate -notify:(enum ConnectionType) presentType; NetworkStatusMonitor - ConnectionType* ct - NSArray* delegates -checkNetStatusAndTypeFor:(NSString*) net - notifyDelegates AppDelegate
  • 13. Remote Invocation Push Resopnse Intent To provide notifications from workflow systems to a mobile user Motivation: Needed to provide a workflow step an acknowledgement, response, or notification. Push notification is more resilient for verifications, app can close or be interrupted and the push will still be received. Consequences: There is additional cost and security considerations with this over a traditional email response. Email is a valid alternative, but does not notify the user directly.
  • 14. Remote Invocation/Push Response (iPhone) iPhone Application sendDeviceToken Web Application initPushFunctions newDeviceListener HTTP Request AuthenticatedRESTAsynch HTTP Response ServerListener QueueRequest ProcessingQueue
  • 15. Remote Invocation/Push Response (iPhone) iPhone Application Web Application ServerProcess Processing Complete didFinishLaunchingWithOptions sendResponseID pushBinaryResponse didReceiveRemoteNotification HTTP Request AuthenticatedRESTPayload HTTP Response ServerListener
  • 16. XMPP Coordinator Stream Pattern Intent Utilize a standard messaging protocol as a baseline for higher level messaging functionality Motivation: This was kind of a eureka moment, but we were stuck trying to find a way to bridge between J2EE based MOM and our Mobile Apps. We decided to create a listener on the XMPP port and to use that to bridge with the phone. Consequences: There is additional cost and security considerations with this over a traditional email response. Email is a valued alternative, but does not notify the user directly.
  • 17. XMPP Coordinator Stream Pattern iPhone XMPP presence: Application show Server initXMPP xmppListener group invite xmppListener Group::init rsrc1@coordsvr Group:<coordid> Activity::Enlist CoordMsg xmppListener Activity::Perform CheckStatus xmppListener Activity::Complete Close xmppListener
  • 18. XMPP Coordinator Notes  Each resource enlists on it’s own  We create a group for a set of resources  Messages and responses are sent to the group  Any phase can fail causing a compelete failure  Since group, all failures are seen by each resource
  • 19. Distributed Mobile Design Patterns  What we covered:  Enterprise Mobile History  What spaces are hot for enterprise mobile  Five patterns for Mobile App enablement  XMPP Coordinator Stream  Remote Invocation/Push Response  Lightweight Network Status  Authenticated REST Requests  Simple REST Request
  • 20. Questions?  Feel free to contact me: Jason H Christensen jason_h_christensen@jasonc411.com Slideshare: jasonc411 Twitter: jasonc411 http://jasonc411.com