91
Integrating iOS Applications with Backend REST Services Monday, October 4th - JAOO - Århus, Denmark

Integrating iOS Applications with Backend REST Services

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Integrating iOS Applications with Backend REST Services

Integrating iOS Applications with Backend REST

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

Page 2: Integrating iOS Applications with Backend REST Services

Adrian Kosmaczewski

Page 3: Integrating iOS Applications with Backend REST Services

akosma software

Page 4: Integrating iOS Applications with Backend REST Services

akosma.comgithub.com/akosma

linkedin.com/in/akosmaformspring.me/akosma

twitter.com/akosmaslideshare.com/akosma

Page 5: Integrating iOS Applications with Backend REST Services
Page 6: Integrating iOS Applications with Backend REST Services

My Software Passion

Page 7: Integrating iOS Applications with Backend REST Services

People

Page 8: Integrating iOS Applications with Backend REST Services

Team members, users, clients, society in general

Page 9: Integrating iOS Applications with Backend REST Services

Software is a process

Page 10: Integrating iOS Applications with Backend REST Services

Software is a social process

Page 11: Integrating iOS Applications with Backend REST Services
Page 12: Integrating iOS Applications with Backend REST Services

One Problem

Page 13: Integrating iOS Applications with Backend REST Services

Several Solutions

Page 14: Integrating iOS Applications with Backend REST Services
Page 15: Integrating iOS Applications with Backend REST Services

Questions

Page 16: Integrating iOS Applications with Backend REST Services

Web Developers?

Page 17: Integrating iOS Applications with Backend REST Services

iOS Developers?

Page 18: Integrating iOS Applications with Backend REST Services

API Designers or Developers?

Page 19: Integrating iOS Applications with Backend REST Services

Server-side Technologies?

Page 20: Integrating iOS Applications with Backend REST Services
Page 21: Integrating iOS Applications with Backend REST Services

1The Problem

Page 22: Integrating iOS Applications with Backend REST Services

Database

Page 23: Integrating iOS Applications with Backend REST Services

Many Questions

Page 24: Integrating iOS Applications with Backend REST Services

Formats?

Page 25: Integrating iOS Applications with Backend REST Services

Libraries?

Page 26: Integrating iOS Applications with Backend REST Services

“Best” approaches?

Page 27: Integrating iOS Applications with Backend REST Services

2The Solutions

Page 28: Integrating iOS Applications with Backend REST Services

Bad news

Page 29: Integrating iOS Applications with Backend REST Services

Far too many

Page 30: Integrating iOS Applications with Backend REST Services

REST vs SOAP

Page 31: Integrating iOS Applications with Backend REST Services

XML vs JSON

Page 32: Integrating iOS Applications with Backend REST Services

Synchronous vs. Asynchronous

Page 33: Integrating iOS Applications with Backend REST Services
Page 34: Integrating iOS Applications with Backend REST Services

Good News

Page 35: Integrating iOS Applications with Backend REST Services

IntroducingiPhoneWebServicesClient

Page 36: Integrating iOS Applications with Backend REST Services

http://github.com/akosma/iPhoneWebServicesClient

Page 37: Integrating iOS Applications with Backend REST Services

2 parts

Page 38: Integrating iOS Applications with Backend REST Services

1PHP server app

Page 39: Integrating iOS Applications with Backend REST Services

2iOS client

Page 40: Integrating iOS Applications with Backend REST Services

Many formats

Page 41: Integrating iOS Applications with Backend REST Services

XML

Page 42: Integrating iOS Applications with Backend REST Services

JSON

Page 43: Integrating iOS Applications with Backend REST Services

(duh)

Page 44: Integrating iOS Applications with Backend REST Services

• XML

• 8 libraries

• JSON

• 2 parsers

• YAML

• CSV

• SOAP

• Property List

• XML

• Binary

• Protocol Buffers

Page 45: Integrating iOS Applications with Backend REST Services

Extensible

Page 46: Integrating iOS Applications with Backend REST Services

(add more formats and libraries if you want)

Page 47: Integrating iOS Applications with Backend REST Services

Variable sized dataset

Page 48: Integrating iOS Applications with Backend REST Services

(from 1 to 5000 items per call)

Page 49: Integrating iOS Applications with Backend REST Services

Heterogenous Data Source

Page 50: Integrating iOS Applications with Backend REST Services

(the same data in different formats)

Page 51: Integrating iOS Applications with Backend REST Services

XML Libraries

Page 52: Integrating iOS Applications with Backend REST Services

(lots of them)

Page 53: Integrating iOS Applications with Backend REST Services
Page 54: Integrating iOS Applications with Backend REST Services

3Demo

Page 55: Integrating iOS Applications with Backend REST Services
Page 56: Integrating iOS Applications with Backend REST Services

4The Tests

Page 57: Integrating iOS Applications with Backend REST Services

• Local

• Wifi

• 3G

• EDGE

• All Combinations

• Different dataset sizes each time

Page 58: Integrating iOS Applications with Backend REST Services
Page 59: Integrating iOS Applications with Backend REST Services

5Results

Page 60: Integrating iOS Applications with Backend REST Services

Easier to implement on the iOS side?

Page 61: Integrating iOS Applications with Backend REST Services

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

Easier to implement on the PHP side?

Page 63: Integrating iOS Applications with Backend REST Services

1. JSON + YAML

2. Property List + CSV + XML

3. Protocol Buffers

4. SOAP

Page 64: Integrating iOS Applications with Backend REST Services

Smaller Payload

Page 65: Integrating iOS Applications with Backend REST Services

1. CSV + Protocol Buffers + Binary Plist

2. JSON + YAML

3. XML

4. SOAP

Page 66: Integrating iOS Applications with Backend REST Services

Fastest Deserialization

Speed

Page 67: Integrating iOS Applications with Backend REST Services

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

More Portable?

Page 69: Integrating iOS Applications with Backend REST Services

1. XML + JSON

2. Protocol Buffers + YAML + CSV

3. SOAP

4. Property Lists

Page 70: Integrating iOS Applications with Backend REST Services

More Readable?

Page 71: Integrating iOS Applications with Backend REST Services

1. JSON + YAML

2. XML + XML Property Lists

3. Protocol Buffers

4. Binary Property Lists

Page 72: Integrating iOS Applications with Backend REST Services

Less Memory Consumption?

Page 73: Integrating iOS Applications with Backend REST Services

1. Binary Property List + Protocol Buffers

2. CSV + JSON + TBXML

3. XML

4. SOAP + APXML

Page 74: Integrating iOS Applications with Backend REST Services

Some raw, deeply flawed comparisons?

Page 75: Integrating iOS Applications with Backend REST Services

• 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

The “Best”?

Page 77: Integrating iOS Applications with Backend REST Services

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
Page 79: Integrating iOS Applications with Backend REST Services

6Next Steps

Page 80: Integrating iOS Applications with Backend REST Services

Test with other server-side

technologies

Page 81: Integrating iOS Applications with Backend REST Services

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

Page 82: Integrating iOS Applications with Backend REST Services

Test with other Cocoa networking libraries

Page 83: Integrating iOS Applications with Backend REST Services

• 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

Test with other serialization systems

Page 85: Integrating iOS Applications with Backend REST Services

• 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

Test with different data sets

Page 87: Integrating iOS Applications with Backend REST Services

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

Page 88: Integrating iOS Applications with Backend REST Services
Page 89: Integrating iOS Applications with Backend REST Services

Thanks!

Page 90: Integrating iOS Applications with Backend REST Services

Questions?

Page 91: Integrating iOS Applications with Backend REST Services

These slides are released under aCreative Commons Attribution-No Derivative

Works 3.0 Unported License

http://creativecommons.org/licenses/by-nd/3.0/