Integrating iOS Applications with Backend REST Services Monday, - - PowerPoint PPT Presentation

integrating ios applications with backend rest services
SMART_READER_LITE
LIVE PREVIEW

Integrating iOS Applications with Backend REST Services Monday, - - PowerPoint PPT Presentation

Integrating iOS Applications with Backend REST Services Monday, October 4th - JAOO - rhus, Denmark Adrian Kosmaczewski akosma software akosma.com github.com/akosma linkedin.com/in/akosma formspring.me/akosma twitter.com/akosma


slide-1
SLIDE 1

Integrating iOS Applications with Backend REST Services

Monday, October 4th - JAOO - Århus, Denmark

slide-2
SLIDE 2

Adrian Kosmaczewski

slide-3
SLIDE 3

akosma software

slide-4
SLIDE 4

akosma.com github.com/akosma linkedin.com/in/akosma formspring.me/akosma twitter.com/akosma slideshare.com/akosma

slide-5
SLIDE 5
slide-6
SLIDE 6

My Software Passion

slide-7
SLIDE 7

People

slide-8
SLIDE 8

Team members, users, clients, society in general

slide-9
SLIDE 9

Software is a process

slide-10
SLIDE 10

Software is a social process

slide-11
SLIDE 11
slide-12
SLIDE 12

One Problem

slide-13
SLIDE 13

Several Solutions

slide-14
SLIDE 14
slide-15
SLIDE 15

Questions

slide-16
SLIDE 16

Web Developers?

slide-17
SLIDE 17

iOS Developers?

slide-18
SLIDE 18

API Designers or Developers?

slide-19
SLIDE 19

Server-side Technologies?

slide-20
SLIDE 20
slide-21
SLIDE 21

1 The Problem

slide-22
SLIDE 22

Database

slide-23
SLIDE 23

Many Questions

slide-24
SLIDE 24

Formats?

slide-25
SLIDE 25

Libraries?

slide-26
SLIDE 26

“Best” approaches?

slide-27
SLIDE 27

2 The Solutions

slide-28
SLIDE 28

Bad news

slide-29
SLIDE 29

Far too many

slide-30
SLIDE 30

REST vs SOAP

slide-31
SLIDE 31

XML vs JSON

slide-32
SLIDE 32

Synchronous vs. Asynchronous

slide-33
SLIDE 33
slide-34
SLIDE 34

Good News

slide-35
SLIDE 35

Introducing iPhoneWebServicesClient

slide-36
SLIDE 36

http://github.com/akosma/ iPhoneWebServicesClient

slide-37
SLIDE 37

2 parts

slide-38
SLIDE 38

1 PHP server app

slide-39
SLIDE 39

2 iOS client

slide-40
SLIDE 40

Many formats

slide-41
SLIDE 41

XML

slide-42
SLIDE 42

JSON

slide-43
SLIDE 43

(duh)

slide-44
SLIDE 44
  • XML
  • 8 libraries
  • JSON
  • 2 parsers
  • YAML
  • CSV
  • SOAP
  • Property List
  • XML
  • Binary
  • Protocol Buffers
slide-45
SLIDE 45

Extensible

slide-46
SLIDE 46

(add more formats and libraries if you want)

slide-47
SLIDE 47

Variable sized dataset

slide-48
SLIDE 48

(from 1 to 5000 items per call)

slide-49
SLIDE 49

Heterogenous Data Source

slide-50
SLIDE 50

(the same data in different formats)

slide-51
SLIDE 51

XML Libraries

slide-52
SLIDE 52

(lots of them)

slide-53
SLIDE 53
slide-54
SLIDE 54

3 Demo

slide-55
SLIDE 55
slide-56
SLIDE 56

4 The Tests

slide-57
SLIDE 57
  • Local
  • Wifi
  • 3G
  • EDGE
  • All Combinations
  • Different dataset

sizes each time

slide-58
SLIDE 58
slide-59
SLIDE 59

5 Results

slide-60
SLIDE 60

Easier to implement

  • n the iOS side?
slide-61
SLIDE 61
  • 1. JSON + Property Lists + CSV
  • 2. XML (DOM) + Protocol Buffers
  • 3. XML (SAX)
  • 4. SOAP + YAML
slide-62
SLIDE 62

Easier to implement

  • n the PHP side?
slide-63
SLIDE 63
  • 1. JSON + YAML
  • 2. Property List + CSV + XML
  • 3. Protocol Buffers
  • 4. SOAP
slide-64
SLIDE 64

Smaller Payload

slide-65
SLIDE 65
  • 1. CSV + Protocol Buffers + Binary Plist
  • 2. JSON + YAML
  • 3. XML
  • 4. SOAP
slide-66
SLIDE 66

Fastest Deserialization Speed

slide-67
SLIDE 67
  • 1. Property Lists + TBXML
  • 2. SOAP + libxml (DOM) + Google XML
  • 3. JSON
  • 4. YAML + CSV + APXML
slide-68
SLIDE 68

More Portable?

slide-69
SLIDE 69
  • 1. XML + JSON
  • 2. Protocol Buffers + YAML + CSV
  • 3. SOAP
  • 4. Property Lists
slide-70
SLIDE 70

More Readable?

slide-71
SLIDE 71
  • 1. JSON + YAML
  • 2. XML + XML Property Lists
  • 3. Protocol Buffers
  • 4. Binary Property Lists
slide-72
SLIDE 72

Less Memory Consumption?

slide-73
SLIDE 73
  • 1. Binary Property List + Protocol

Buffers

  • 2. CSV + JSON + TBXML
  • 3. XML
  • 4. SOAP + APXML
slide-74
SLIDE 74

Some raw, deeply flawed comparisons?

slide-75
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
SLIDE 76

The “Best”?

slide-77
SLIDE 77
  • 1. JSON + Property Lists
  • 2. TBXML + Protocol Buffers
  • 3. Other XML parsers + CSV
  • 4. YAML + SOAP + APXML
slide-78
SLIDE 78
slide-79
SLIDE 79

6 Next Steps

slide-80
SLIDE 80

Test with other server-side technologies

slide-81
SLIDE 81

(J2EE, ASP.NET, Ruby on Rails, Django...)

slide-82
SLIDE 82

Test with other Cocoa networking libraries

slide-83
SLIDE 83
  • AsyncSocket

http://akos.ma/0x37v

  • IP*Works! for Mac OS X

http://www.nsoftware.com/portal/macos/

  • OmniNetworking

http://akos.ma/0q

  • ThoMoNetworking

http://hci.rwth-aachen.de/thomonet

  • ConnectionKit

http://github.com/karelia/ConnectionKit/

slide-84
SLIDE 84

Test with other serialization systems

slide-85
SLIDE 85
  • MessagePack

http://msgpack.org/

  • Apache Thrift

http://incubator.apache.org/thrift/

  • BERT

http://bert-rpc.org/

  • Apache Avro

http://avro.apache.org/

  • ONC RPC aka Sun RPC

http://akos.ma/va

Open Network Computing Remote Procedure Call

slide-86
SLIDE 86

Test with different data sets

slide-87
SLIDE 87

(sport results, weather, financial data, hyerarchical data, binary data, etc...)

slide-88
SLIDE 88
slide-89
SLIDE 89

Thanks!

slide-90
SLIDE 90

Questions?

slide-91
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/