SlideShare a Scribd company logo
1 of 33
Download to read offline
MOBILE IN THE CLOUD
WITH DIAMONDS

2013

2013
Mobile & Cloud

Content

Bicycles we ride
Essential frameworks
Advanced frameworks
Wondertools
You don't test me
Backends
Imagination
mobile and the internets
m
Developer’s dilemma
★
★
★

faster
know how
solves the problem

VS

FRAMEWORKS

★
★
★

tested
independent
supported
FRAMEWORKS

That could be a pain

RESTawful
services
Data and Cloud

Core Data
Data and Cloud

NSOperation

Core Data
Data and Cloud
NSURLConnection

NSOperation

Core Data
Data and Cloud
AFNetworking

NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/
stream/0/posts/stream/global"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
AFJSONRequestOperation *operation = [AFJSONRequestOperation
JSONRequestOperationWithRequest:request success:^(NSURLRequest
*request, NSHTTPURLResponse *response, id JSON) {!
NSLog(@"App.net Global Stream: %@", JSON);!
} failure:nil];!
[operation start];

NSURLConnection

NSOperation

Core Data
Data and Cloud

REST

KIT
AFNetworking

NSURLConnection

NSOperation

Core Data
Data and Cloud

REST

AFNetworking

NSURLConnection

KIT

NSOperation

Core Data
Data and Cloud - RestKit

Data
Mapping

REST

AFNetworking

NSURLConnection

KIT

NSOperation

Core Data
RestKit example
@interface RKTweet NSObject!
@interface RKTweet : : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
@end!
!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!

!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:
[mapping class]];!
[RKTweet addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.id":
@"userID",!
@"user.name": @"text"!
@"username",!
@"text":
@"userID",!
}];! @"user.id":
!
@"text":
@"text"!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
}];
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!

!

NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
statusCodes:nil];! URLWithString:@"http://api.twitter.com/1/statuses/
NSURL *url = [NSURL
public_timeline.json"];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/
NSURLRequest *request = [NSURLRequest
statuses/public_timeline.json"];! requestWithURL:url];!
RKObjectRequestOperation [NSURLRequest requestWithURL:url];!
NSURLRequest *request = *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
alloc] initWithRequest:request
*operation, RKMappingResult *result) {!
responseDescriptors:@[responseDescriptor]];
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
} failure:nil];!
[operation start];
[operation start];
RestKit example
@interface RKTweet : NSObject!
@property (nonatomic, copy) NSNumber *userID;!
@property (nonatomic, copy) NSString *username;!
@property (nonatomic, copy) NSString *text;!
@end!
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet
class]];!
[mapping addAttributeMappingsFromDictionary:@{!
@"user.name":
@"username",!
@"user.id":
@"userID",!
@"text":
@"text"!
}];!
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor
responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil
statusCodes:nil];!
NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/
public_timeline.json"];!
NSURLRequest *request = [NSURLRequest requestWithURL:url];!
RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc]
initWithRequest:request responseDescriptors:@[responseDescriptor]];!
[operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation
*operation, RKMappingResult *result) {!
NSLog(@"The public timeline Tweets: %@", [result array]);!
} failure:nil];!
[operation start];
Next Step
NSIncrementalStore

NSURLConnection

NSOperation

Core Data
Next Step
AFNetworking

NSIncrementalStore

NSURLConnection

NSOperation

Core Data
Next Step

AFNetworking

NSURLConnection

NSIncrementalStore

NSOperation

Core Data
Next Step - Data Sync
AFIncrementalStore

AFNetworking

NSURLConnection

NSIncrementalStore

NSOperation

Core Data
a snap into AFIncrementalStore
usual

unusual

YOUR CODE

YOUR CODE

RESTful server

CoreData
framework

CoreData
framework
+
AF
Incremental
Store

AFNetworking
working with AFIncrementalStore
is the same as with CoreData
@interface
TasksViewController()<NSFetchedResultsControllerDelegate>!
@property NSFetchedResultsController *fetchedResultsController;!
@end!
!
- (UITableViewCell *)tableView:(UITableView *)tableView!
cellForRowAtIndexPath:(NSIndexPath *)indexPath !
{!

...!
[self configureCell:cell forRowAtIndexPath:indexPath];!
return cell;!
}!
!
- (void)configureCell:(UITableViewCell *)cell !
forRowAtIndexPath:(NSIndexPath *)indexPath !
{!
NSManagedObject *managedObject = [self.fetchedResultsController
objectAtIndexPath:indexPath];!
cell.textLabel.text = [managedObject valueForKey:@"text"];!
?
?
?

Business Logic
AFIncrementalStore
⦿Push Notifications
⦿InAppPurchase

⦿ Analytics
⦿ Passbook
⦿ Newsstand

Sync.

with just one command...*

#	
  helios	
  server
Helios-ready iOS frameworks
Antenna

Cargo Bay

Extensible Remote Logging

The Essential StoreKit
Companion

Orbiter

AFIncrementalStore

Push Notification
Registration

Core Data Persistence with
AFNetworking, Done Right

SkyLab
Multivariate & A/B Testing

Ground Control
Remote Configuration

AFNetworking
A Delightful iOS & OS X
Networking Framework
Cocoa Pods
http://cocoapods.org
$ [sudo] gem install cocoapods
$ pod setup
myproject$ pod install
Podfile example:
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.0.3’
pod 'ICViewPager', '~> 1.5’

RestKit
AFNetworking
AFIncrementalStore
AFAmazonS3Client
...
https://github.com/
CocoaPods/Specs
Testing
★

many frameworks comes with tests, bros

KIF

FRANK

https://github.com/kif-framework/KIF
https://github.com/moredip/Frank
KIF
★
★
★

leveraging the accessibility attributes
conducted synchronously in the main thread
uses undocumented Apple APIs

- (void)testSuccessfulLogin!
{!
[tester enterText:@"user@example.com"
intoViewWithAccessibilityLabel:@"Login User Name"];!
[tester enterText:@"thisismypassword"
intoViewWithAccessibilityLabel:@"Login Password"];!
[tester tapViewWithAccessibilityLabel:@"Log In"];!
!
// Verify that the login succeeded!
[tester waitForTappableViewWithAccessibilityLabel:@"Welcome"];!
}
★
★
★
★

FRANK

from outer ruby space ‘cucumber’
'Selenium for native iOS apps'.
uses undocumented Apple APIs
totally different approach to testing in iOS

Feature: Various scenarios that exercise different parts of Frank!
!
Background:!
Given I launch the app !
!
Scenario: Counting number of rows in a table section!
Then I should see 3 rows in section 0!
!
Scenario: Scrolling to the bottom of the table !
When I touch "Larry Stooge"!
And I touch "User Roles"!
Then I should not see "Returns"!
When I scroll to the bottom of the table!
Then I should see "Returns"
READY TO USE CLOUDS
★Deployd.com
- free to use
- javascript based
★★Parse.com
-all essential platforms supported
-“out of the box” basic data entities
-free to test
★★★APIgee.com (books & webcasts)
- developer console to popular services
- intermediate data processing (eg.
-

convert xml to json, mapping, etc)
free to test
Oleg.Shanyuk@gmail.com
@gelosi - http://obrij.com

AFNetworking, AFIncrementalStore, AF***
https://github.com/helios-framework/helios
RESTKit - https://github.com/RestKit/RestKit
CocoaPods - http://cocoapods.org
Follow: @mattt, @soffes, @gruber, @edog1203

More Related Content

What's hot

Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesWebStackAcademy
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationWebStackAcademy
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actionsAren Zomorodian
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC
 
Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012sullis
 
Paris Tech Meetup talk : Troubles start at version 1.0
Paris Tech Meetup talk : Troubles start at version 1.0Paris Tech Meetup talk : Troubles start at version 1.0
Paris Tech Meetup talk : Troubles start at version 1.0Laurent Cerveau
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generationEleonora Ciceri
 
Introduction about-ajax-framework
Introduction about-ajax-frameworkIntroduction about-ajax-framework
Introduction about-ajax-frameworkSakthi Bro
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationWebStackAcademy
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodbKnoldus Inc.
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDBBen Gotow
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Codemotion
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Ayes Chinmay
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBApaichon Punopas
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile appsIvano Malavolta
 

What's hot (20)

Angular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP ServicesAngular - Chapter 7 - HTTP Services
Angular - Chapter 7 - HTTP Services
 
Node js crash course session 3
Node js crash course   session 3Node js crash course   session 3
Node js crash course session 3
 
Node js crash course session 5
Node js crash course   session 5Node js crash course   session 5
Node js crash course session 5
 
Angular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and AuthorizationAngular - Chapter 9 - Authentication and Authorization
Angular - Chapter 9 - Authentication and Authorization
 
Web Technologies - forms and actions
Web Technologies -  forms and actionsWeb Technologies -  forms and actions
Web Technologies - forms and actions
 
FITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JSFITC presents: Mobile & offline data synchronization in Angular JS
FITC presents: Mobile & offline data synchronization in Angular JS
 
Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012
 
Paris Tech Meetup talk : Troubles start at version 1.0
Paris Tech Meetup talk : Troubles start at version 1.0Paris Tech Meetup talk : Troubles start at version 1.0
Paris Tech Meetup talk : Troubles start at version 1.0
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
 
Introduction about-ajax-framework
Introduction about-ajax-frameworkIntroduction about-ajax-framework
Introduction about-ajax-framework
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
 
Scala with mongodb
Scala with mongodbScala with mongodb
Scala with mongodb
 
Ajax
AjaxAjax
Ajax
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDB
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
 
Change RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDBChange RelationalDB to GraphDB with OrientDB
Change RelationalDB to GraphDB with OrientDB
 
AJAX - An introduction
AJAX - An introductionAJAX - An introduction
AJAX - An introduction
 
[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps[2015/2016] Local data storage for web-based mobile apps
[2015/2016] Local data storage for web-based mobile apps
 

Similar to MOBILE CLOUD REST WITH DIAMONDS

MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"ITGinGer
 
RESTfull with RestKit
RESTfull with RestKitRESTfull with RestKit
RESTfull with RestKitTaras Kalapun
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)Masaki Oshikawa
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsRan Mizrahi
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Satoshi Asano
 
iPhone and Rails integration
iPhone and Rails integrationiPhone and Rails integration
iPhone and Rails integrationPaul Ardeleanu
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applicationslmrei
 
MVC Puree - Approaches to MVC with Umbraco
MVC Puree - Approaches to MVC with UmbracoMVC Puree - Approaches to MVC with Umbraco
MVC Puree - Approaches to MVC with UmbracoAndy Butland
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js frameworkBen Lin
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Loiane Groner
 
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCABeginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCAWhymca
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWeare-Legion
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.jsYoann Gotthilf
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced FunctionsWebStackAcademy
 

Similar to MOBILE CLOUD REST WITH DIAMONDS (20)

MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
MPD2011 | Сергей Клюев "RESTfull iOS with RestKit"
 
RESTfull with RestKit
RESTfull with RestKitRESTfull with RestKit
RESTfull with RestKit
 
NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)NyaruDBにゃるものを使ってみた話 (+Realm比較)
NyaruDBにゃるものを使ってみた話 (+Realm比較)
 
How AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design PatternsHow AngularJS Embraced Traditional Design Patterns
How AngularJS Embraced Traditional Design Patterns
 
UIWebView Tips
UIWebView TipsUIWebView Tips
UIWebView Tips
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
iPhone and Rails integration
iPhone and Rails integrationiPhone and Rails integration
iPhone and Rails integration
 
Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
MVC Puree - Approaches to MVC with Umbraco
MVC Puree - Approaches to MVC with UmbracoMVC Puree - Approaches to MVC with Umbraco
MVC Puree - Approaches to MVC with Umbraco
 
How and why i roll my own node.js framework
How and why i roll my own node.js frameworkHow and why i roll my own node.js framework
How and why i roll my own node.js framework
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
 
Beginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCABeginning icloud development - Cesare Rocchi - WhyMCA
Beginning icloud development - Cesare Rocchi - WhyMCA
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear
«ReactiveCocoa и MVVM» — Николай Касьянов, SoftWear
 
Introduction to REST API with Node.js
Introduction to REST API with Node.jsIntroduction to REST API with Node.js
Introduction to REST API with Node.js
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
JavaScript - Chapter 7 - Advanced Functions
 JavaScript - Chapter 7 - Advanced Functions JavaScript - Chapter 7 - Advanced Functions
JavaScript - Chapter 7 - Advanced Functions
 

Recently uploaded

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Recently uploaded (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

MOBILE CLOUD REST WITH DIAMONDS

  • 1. MOBILE IN THE CLOUD WITH DIAMONDS 2013 2013
  • 2.
  • 3. Mobile & Cloud Content Bicycles we ride Essential frameworks Advanced frameworks Wondertools You don't test me Backends Imagination
  • 4. mobile and the internets m
  • 5. Developer’s dilemma ★ ★ ★ faster know how solves the problem VS FRAMEWORKS ★ ★ ★ tested independent supported
  • 6. FRAMEWORKS That could be a pain RESTawful services
  • 10. Data and Cloud AFNetworking NSURL *url = [NSURL URLWithString:@"https://alpha-api.app.net/ stream/0/posts/stream/global"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {! NSLog(@"App.net Global Stream: %@", JSON);! } failure:nil];! [operation start]; NSURLConnection NSOperation Core Data
  • 13. Data and Cloud - RestKit Data Mapping REST AFNetworking NSURLConnection KIT NSOperation Core Data
  • 14. RestKit example @interface RKTweet NSObject! @interface RKTweet : : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! @end! ! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 15. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! ! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! RKObjectMapping *mapping = [RKObjectMapping mappingForClass: [mapping class]];! [RKTweet addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! [mapping addAttributeMappingsFromDictionary:@{! @"user.id": @"userID",! @"user.name": @"text"! @"username",! @"text": @"userID",! }];! @"user.id": ! @"text": @"text"! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor }]; responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! ! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! ! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 16. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! statusCodes:nil];! URLWithString:@"http://api.twitter.com/1/statuses/ NSURL *url = [NSURL public_timeline.json"];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/ NSURLRequest *request = [NSURLRequest statuses/public_timeline.json"];! requestWithURL:url];! RKObjectRequestOperation [NSURLRequest requestWithURL:url];! NSURLRequest *request = *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation alloc] initWithRequest:request *operation, RKMappingResult *result) {! responseDescriptors:@[responseDescriptor]]; NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 17. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! } failure:nil];! [operation start]; [operation start];
  • 18. RestKit example @interface RKTweet : NSObject! @property (nonatomic, copy) NSNumber *userID;! @property (nonatomic, copy) NSString *username;! @property (nonatomic, copy) NSString *text;! @end! RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[RKTweet class]];! [mapping addAttributeMappingsFromDictionary:@{! @"user.name": @"username",! @"user.id": @"userID",! @"text": @"text"! }];! RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:mapping pathPattern:nil keyPath:nil statusCodes:nil];! NSURL *url = [NSURL URLWithString:@"http://api.twitter.com/1/statuses/ public_timeline.json"];! NSURLRequest *request = [NSURLRequest requestWithURL:url];! RKObjectRequestOperation *operation = [[RKObjectRequestOperation alloc] initWithRequest:request responseDescriptors:@[responseDescriptor]];! [operation setCompletionBlockWithSuccess:^(RKObjectRequestOperation *operation, RKMappingResult *result) {! NSLog(@"The public timeline Tweets: %@", [result array]);! } failure:nil];! [operation start];
  • 22. Next Step - Data Sync AFIncrementalStore AFNetworking NSURLConnection NSIncrementalStore NSOperation Core Data
  • 23. a snap into AFIncrementalStore usual unusual YOUR CODE YOUR CODE RESTful server CoreData framework CoreData framework + AF Incremental Store AFNetworking
  • 24. working with AFIncrementalStore is the same as with CoreData @interface TasksViewController()<NSFetchedResultsControllerDelegate>! @property NSFetchedResultsController *fetchedResultsController;! @end! ! - (UITableViewCell *)tableView:(UITableView *)tableView! cellForRowAtIndexPath:(NSIndexPath *)indexPath ! {! ...! [self configureCell:cell forRowAtIndexPath:indexPath];! return cell;! }! ! - (void)configureCell:(UITableViewCell *)cell ! forRowAtIndexPath:(NSIndexPath *)indexPath ! {! NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];! cell.textLabel.text = [managedObject valueForKey:@"text"];!
  • 26. ⦿Push Notifications ⦿InAppPurchase ⦿ Analytics ⦿ Passbook ⦿ Newsstand Sync. with just one command...* #  helios  server
  • 27. Helios-ready iOS frameworks Antenna Cargo Bay Extensible Remote Logging The Essential StoreKit Companion Orbiter AFIncrementalStore Push Notification Registration Core Data Persistence with AFNetworking, Done Right SkyLab Multivariate & A/B Testing Ground Control Remote Configuration AFNetworking A Delightful iOS & OS X Networking Framework
  • 28. Cocoa Pods http://cocoapods.org $ [sudo] gem install cocoapods $ pod setup myproject$ pod install Podfile example: platform :ios, '7.0' pod 'AFNetworking', '~> 2.0.3’ pod 'ICViewPager', '~> 1.5’ RestKit AFNetworking AFIncrementalStore AFAmazonS3Client ... https://github.com/ CocoaPods/Specs
  • 29. Testing ★ many frameworks comes with tests, bros KIF FRANK https://github.com/kif-framework/KIF https://github.com/moredip/Frank
  • 30. KIF ★ ★ ★ leveraging the accessibility attributes conducted synchronously in the main thread uses undocumented Apple APIs - (void)testSuccessfulLogin! {! [tester enterText:@"user@example.com" intoViewWithAccessibilityLabel:@"Login User Name"];! [tester enterText:@"thisismypassword" intoViewWithAccessibilityLabel:@"Login Password"];! [tester tapViewWithAccessibilityLabel:@"Log In"];! ! // Verify that the login succeeded! [tester waitForTappableViewWithAccessibilityLabel:@"Welcome"];! }
  • 31. ★ ★ ★ ★ FRANK from outer ruby space ‘cucumber’ 'Selenium for native iOS apps'. uses undocumented Apple APIs totally different approach to testing in iOS Feature: Various scenarios that exercise different parts of Frank! ! Background:! Given I launch the app ! ! Scenario: Counting number of rows in a table section! Then I should see 3 rows in section 0! ! Scenario: Scrolling to the bottom of the table ! When I touch "Larry Stooge"! And I touch "User Roles"! Then I should not see "Returns"! When I scroll to the bottom of the table! Then I should see "Returns"
  • 32. READY TO USE CLOUDS ★Deployd.com - free to use - javascript based ★★Parse.com -all essential platforms supported -“out of the box” basic data entities -free to test ★★★APIgee.com (books & webcasts) - developer console to popular services - intermediate data processing (eg. - convert xml to json, mapping, etc) free to test
  • 33. Oleg.Shanyuk@gmail.com @gelosi - http://obrij.com AFNetworking, AFIncrementalStore, AF*** https://github.com/helios-framework/helios RESTKit - https://github.com/RestKit/RestKit CocoaPods - http://cocoapods.org Follow: @mattt, @soffes, @gruber, @edog1203