SLIDE 1 Integrating iOS Applications with Backend REST Services
Monday, October 4th - JAOO - Århus, Denmark
SLIDE 2
Adrian Kosmaczewski
SLIDE 3
akosma software
SLIDE 4 akosma.com github.com/akosma linkedin.com/in/akosma formspring.me/akosma twitter.com/akosma slideshare.com/akosma
SLIDE 5
SLIDE 6
My Software Passion
SLIDE 7
People
SLIDE 8 Team members, users, clients, society in general
SLIDE 9
Software is a process
SLIDE 10
Software is a social process
SLIDE 11
SLIDE 12
One Problem
SLIDE 13
Several Solutions
SLIDE 14
SLIDE 15
Questions
SLIDE 16
Web Developers?
SLIDE 17
iOS Developers?
SLIDE 18
API Designers or Developers?
SLIDE 19
Server-side Technologies?
SLIDE 20
SLIDE 21
1 The Problem
SLIDE 23
Many Questions
SLIDE 24
Formats?
SLIDE 25
Libraries?
SLIDE 26
“Best” approaches?
SLIDE 27
2 The Solutions
SLIDE 28
Bad news
SLIDE 29
Far too many
SLIDE 30
REST vs SOAP
SLIDE 31
XML vs JSON
SLIDE 32
Synchronous vs. Asynchronous
SLIDE 33
SLIDE 34
Good News
SLIDE 35
Introducing iPhoneWebServicesClient
SLIDE 36 http://github.com/akosma/ iPhoneWebServicesClient
SLIDE 37
2 parts
SLIDE 38
1 PHP server app
SLIDE 39
2 iOS client
SLIDE 40
Many formats
SLIDE 41
XML
SLIDE 42
JSON
SLIDE 44
- XML
- 8 libraries
- JSON
- 2 parsers
- YAML
- CSV
- SOAP
- Property List
- XML
- Binary
- Protocol Buffers
SLIDE 45
Extensible
SLIDE 46 (add more formats and libraries if you want)
SLIDE 47
Variable sized dataset
SLIDE 48 (from 1 to 5000 items per call)
SLIDE 49
Heterogenous Data Source
SLIDE 50 (the same data in different formats)
SLIDE 51
XML Libraries
SLIDE 53
SLIDE 54
3 Demo
SLIDE 55
SLIDE 56
4 The Tests
SLIDE 57
- Local
- Wifi
- 3G
- EDGE
- All Combinations
- Different dataset
sizes each time
SLIDE 58
SLIDE 59
5 Results
SLIDE 60 Easier to implement
SLIDE 61
- 1. JSON + Property Lists + CSV
- 2. XML (DOM) + Protocol Buffers
- 3. XML (SAX)
- 4. SOAP + YAML
SLIDE 62 Easier to implement
SLIDE 63
- 1. JSON + YAML
- 2. Property List + CSV + XML
- 3. Protocol Buffers
- 4. SOAP
SLIDE 64
Smaller Payload
SLIDE 65
- 1. CSV + Protocol Buffers + Binary Plist
- 2. JSON + YAML
- 3. XML
- 4. SOAP
SLIDE 66
Fastest Deserialization Speed
SLIDE 67
- 1. Property Lists + TBXML
- 2. SOAP + libxml (DOM) + Google XML
- 3. JSON
- 4. YAML + CSV + APXML
SLIDE 68
More Portable?
SLIDE 69
- 1. XML + JSON
- 2. Protocol Buffers + YAML + CSV
- 3. SOAP
- 4. Property Lists
SLIDE 70
More Readable?
SLIDE 71
- 1. JSON + YAML
- 2. XML + XML Property Lists
- 3. Protocol Buffers
- 4. Binary Property Lists
SLIDE 72
Less Memory Consumption?
SLIDE 73
- 1. Binary Property List + Protocol
Buffers
- 2. CSV + JSON + TBXML
- 3. XML
- 4. SOAP + APXML
SLIDE 74
Some raw, deeply flawed comparisons?
SLIDE 75
- 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
SLIDE 76
The “Best”?
SLIDE 77
- 1. JSON + Property Lists
- 2. TBXML + Protocol Buffers
- 3. Other XML parsers + CSV
- 4. YAML + SOAP + APXML
SLIDE 78
SLIDE 79
6 Next Steps
SLIDE 80
Test with other server-side technologies
SLIDE 81 (J2EE, ASP.NET, Ruby on Rails, Django...)
SLIDE 82
Test with other Cocoa networking libraries
SLIDE 83
http://akos.ma/0x37v
http://www.nsoftware.com/portal/macos/
http://akos.ma/0q
http://hci.rwth-aachen.de/thomonet
http://github.com/karelia/ConnectionKit/
SLIDE 84
Test with other serialization systems
SLIDE 85
http://msgpack.org/
http://incubator.apache.org/thrift/
http://bert-rpc.org/
http://avro.apache.org/
http://akos.ma/va
Open Network Computing Remote Procedure Call
SLIDE 86
Test with different data sets
SLIDE 87 (sport results, weather, financial data, hyerarchical data, binary data, etc...)
SLIDE 88
SLIDE 89
Thanks!
SLIDE 90
Questions?
SLIDE 91 These slides are released under a Creative Commons Attribution-No Derivative Works 3.0 Unported License http://creativecommons.org/licenses/by-nd/3.0/