YAML / JSON / XML: which one to choose for IPhone for RESTFul communication?

I am writing a simple application that communicates with an external server. The server currently supports yaml, xml and json.

  • What encoding is faster on the iPhone?
  • Which is better to maintain?
  • What libraries do you offer?
+3
source share
9 answers

, Motorola J2ME . , ( 2.5G 2004 ). , ( JSON YAML). , Hessian Google Protocol Buffers.

, , iPhone , , HTTP , HTTP If-Modified .. REST, HTTP.

, , .

+5

iPhone OS 3.0, , REST SOAP iPhone, XML ( 8 iPhone-), SOAP, JSON ( SBJSON TouchJSON), YAML, ( Google) CSV PHP ( ).

http://github.com/akosma/iPhoneWebServicesClient

.

SlideShare , :

http://www.slideshare.net/akosma/web-services-3439269

, Binary Plists + REST + JSON XML + TBXML "" ( : + + ).

Github "" Excel, ( ). 3G Wi-Fi, .

, !

+3
+2

, XML, plist, iphone. JSON , c libs. JSON XML .

XML - - .

, - - btw, REST .

+1

, , :

http://www.servicestack.net/benchmarks/NorthwindDatabaseRowsSerialization.1000000-times.2010-02-06.html

, - .NET, , .

Marc protobuf-net :

  • 6.72x 4.68x MS Xml Serializer;
  • 10.18x 2.24x , MS JSON DataContract Serializer;

, .

MonoTouch (, #/Mono iPhone) , Javascript- , , XML JSON, :

  • 3.5x 2.6x , XML DataContract serializer;
  • 5.3x 1,3x , JSON DataContract.

MonoTouch, , - iPhone: http://www.servicestack.net/monotouch/remote-info/

+1

IF ++ iPhone, , yaml-cpp:

http://code.google.com/p/yaml-cpp/

  • iPhone ( cmake)
  • cmake
  • ++ ( , ) (. wiki/HowToParseADocument).
+1

, . , XML - XQuery. , JSON . YAML.

0

YAML ( , ). , TouchJSON , , , .

JSON , XML PLIST, , .

pLists , . JSON, . NSDateFormatter , , .

0

Support for all three formats in Objective-C is supported. Just google for them. I would suggest writing a serializer that supports all three. Just make a request for the URL resource using .xml | .json | .yaml, and the server decided what to serialize based on this extension. Then you actually do not need to decide that you can switch to whatever you want. Making serializer compatible is very simple in most server-side implementations.

0
source

Source: https://habr.com/ru/post/1732266/


All Articles