REST API Connected Apps Windows Store iOS Android Windows Phone 8 iOS Android HTML 5/JS.
Integrating iOS Applications with Backend REST Services
Transcript of Integrating iOS Applications with Backend REST Services
![Page 1: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/1.jpg)
Integrating iOS Applications with Backend REST
ServicesMonday, October 4th - JAOO - Århus, Denmark
![Page 2: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/2.jpg)
Adrian Kosmaczewski
![Page 3: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/3.jpg)
akosma software
![Page 4: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/4.jpg)
akosma.comgithub.com/akosma
linkedin.com/in/akosmaformspring.me/akosma
twitter.com/akosmaslideshare.com/akosma
![Page 5: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/5.jpg)
![Page 6: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/6.jpg)
My Software Passion
![Page 7: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/7.jpg)
People
![Page 8: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/8.jpg)
Team members, users, clients, society in general
![Page 9: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/9.jpg)
Software is a process
![Page 10: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/10.jpg)
Software is a social process
![Page 11: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/11.jpg)
![Page 12: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/12.jpg)
One Problem
![Page 13: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/13.jpg)
Several Solutions
![Page 14: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/14.jpg)
![Page 15: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/15.jpg)
Questions
![Page 16: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/16.jpg)
Web Developers?
![Page 17: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/17.jpg)
iOS Developers?
![Page 18: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/18.jpg)
API Designers or Developers?
![Page 19: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/19.jpg)
Server-side Technologies?
![Page 20: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/20.jpg)
![Page 21: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/21.jpg)
1The Problem
![Page 22: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/22.jpg)
Database
![Page 23: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/23.jpg)
Many Questions
![Page 24: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/24.jpg)
Formats?
![Page 25: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/25.jpg)
Libraries?
![Page 26: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/26.jpg)
“Best” approaches?
![Page 27: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/27.jpg)
2The Solutions
![Page 28: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/28.jpg)
Bad news
![Page 29: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/29.jpg)
Far too many
![Page 30: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/30.jpg)
REST vs SOAP
![Page 31: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/31.jpg)
XML vs JSON
![Page 32: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/32.jpg)
Synchronous vs. Asynchronous
![Page 33: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/33.jpg)
![Page 34: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/34.jpg)
Good News
![Page 35: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/35.jpg)
IntroducingiPhoneWebServicesClient
![Page 36: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/36.jpg)
http://github.com/akosma/iPhoneWebServicesClient
![Page 37: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/37.jpg)
2 parts
![Page 38: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/38.jpg)
1PHP server app
![Page 39: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/39.jpg)
2iOS client
![Page 40: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/40.jpg)
Many formats
![Page 41: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/41.jpg)
XML
![Page 42: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/42.jpg)
JSON
![Page 43: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/43.jpg)
(duh)
![Page 44: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/44.jpg)
• XML
• 8 libraries
• JSON
• 2 parsers
• YAML
• CSV
• SOAP
• Property List
• XML
• Binary
• Protocol Buffers
![Page 45: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/45.jpg)
Extensible
![Page 46: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/46.jpg)
(add more formats and libraries if you want)
![Page 47: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/47.jpg)
Variable sized dataset
![Page 48: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/48.jpg)
(from 1 to 5000 items per call)
![Page 49: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/49.jpg)
Heterogenous Data Source
![Page 50: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/50.jpg)
(the same data in different formats)
![Page 51: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/51.jpg)
XML Libraries
![Page 52: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/52.jpg)
(lots of them)
![Page 53: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/53.jpg)
![Page 54: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/54.jpg)
3Demo
![Page 55: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/55.jpg)
![Page 56: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/56.jpg)
4The Tests
![Page 57: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/57.jpg)
• Local
• Wifi
• 3G
• EDGE
• All Combinations
• Different dataset sizes each time
![Page 58: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/58.jpg)
![Page 59: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/59.jpg)
5Results
![Page 60: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/60.jpg)
Easier to implement on the iOS side?
![Page 61: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/61.jpg)
1. JSON + Property Lists + CSV
2. XML (DOM) + Protocol Buffers
3. XML (SAX)
4. SOAP + YAML
![Page 62: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/62.jpg)
Easier to implement on the PHP side?
![Page 63: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/63.jpg)
1. JSON + YAML
2. Property List + CSV + XML
3. Protocol Buffers
4. SOAP
![Page 64: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/64.jpg)
Smaller Payload
![Page 65: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/65.jpg)
1. CSV + Protocol Buffers + Binary Plist
2. JSON + YAML
3. XML
4. SOAP
![Page 66: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/66.jpg)
Fastest Deserialization
Speed
![Page 67: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/67.jpg)
1. Property Lists + TBXML
2. SOAP + libxml (DOM) + Google XML
3. JSON
4. YAML + CSV + APXML
![Page 68: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/68.jpg)
More Portable?
![Page 69: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/69.jpg)
1. XML + JSON
2. Protocol Buffers + YAML + CSV
3. SOAP
4. Property Lists
![Page 70: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/70.jpg)
More Readable?
![Page 71: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/71.jpg)
1. JSON + YAML
2. XML + XML Property Lists
3. Protocol Buffers
4. Binary Property Lists
![Page 72: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/72.jpg)
Less Memory Consumption?
![Page 73: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/73.jpg)
1. Binary Property List + Protocol Buffers
2. CSV + JSON + TBXML
3. XML
4. SOAP + APXML
![Page 74: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/74.jpg)
Some raw, deeply flawed comparisons?
![Page 75: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/75.jpg)
• Binary Plists are 3 to 4 times faster to deserialize than JSON
• iPod touch 2nd Gen is ~25% faster than iPhone 3G
• iPhone 4 is ~300% faster than iPhone 3G
• JSON is 45% of its equivalent XML plist
• Binary plist is 35% of its equivalent XML plist
![Page 76: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/76.jpg)
The “Best”?
![Page 77: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/77.jpg)
1. JSON + Property Lists
2. TBXML + Protocol Buffers
3. Other XML parsers + CSV
4. YAML + SOAP + APXML
![Page 78: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/78.jpg)
![Page 79: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/79.jpg)
6Next Steps
![Page 80: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/80.jpg)
Test with other server-side
technologies
![Page 81: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/81.jpg)
(J2EE, ASP.NET, Ruby on Rails, Django...)
![Page 82: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/82.jpg)
Test with other Cocoa networking libraries
![Page 83: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/83.jpg)
• AsyncSocket http://akos.ma/0x37v
• IP*Works! for Mac OS X http://www.nsoftware.com/portal/macos/
• OmniNetworkinghttp://akos.ma/0q
• ThoMoNetworkinghttp://hci.rwth-aachen.de/thomonet
• ConnectionKithttp://github.com/karelia/ConnectionKit/
![Page 84: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/84.jpg)
Test with other serialization systems
![Page 85: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/85.jpg)
• MessagePack http://msgpack.org/
• Apache Thrift http://incubator.apache.org/thrift/
• BERThttp://bert-rpc.org/
• Apache Avrohttp://avro.apache.org/
• ONC RPC aka Sun RPChttp://akos.ma/va
Open Network Computing Remote Procedure Call
![Page 86: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/86.jpg)
Test with different data sets
![Page 87: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/87.jpg)
(sport results, weather, financial data, hyerarchical data, binary data, etc...)
![Page 88: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/88.jpg)
![Page 89: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/89.jpg)
Thanks!
![Page 90: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/90.jpg)
Questions?
![Page 91: Integrating iOS Applications with Backend REST Services](https://reader030.fdocuments.in/reader030/viewer/2022020703/61fb35052e268c58cd5b6d6d/html5/thumbnails/91.jpg)
These slides are released under aCreative Commons Attribution-No Derivative
Works 3.0 Unported License
http://creativecommons.org/licenses/by-nd/3.0/