[Linuxtrent] Protocol Buffers, l'erede di XML?

  • From: "Luca Manganelli" <luca76@xxxxxxxxx>
  • To: linuxtrent@xxxxxxxxxxxxx
  • Date: Mon, 14 Jul 2008 09:42:30 +0200

Sto leggendo la documentazione di questo nuovo protocollo, e devo dire
che mi "garba" parecchio.

http://code.google.com/apis/protocolbuffers/docs/overview.html

Why not just use XML?

Protocol buffers have many advantages over XML for serializing
structured data. Protocol buffers:

    * are simpler
    * are 3 to 10 times smaller
    * are 20 to 100 times faster
    * are less ambiguous
    * generate data access classes that are easier to use programmatically

For example, let's say you want to model a person with a name and an
email. In XML, you need to do:

  <person>
    <name>John Doe</name>
    <email>jdoe@xxxxxxxxxxx</email>
  </person>

while the corresponding protocol buffer message (in protocol buffer
text format) is:

# Textual representation of a protocol buffer.
# This is *not* the binary format used on the wire.
person {
  name: "John Doe"
  email: "jdoe@xxxxxxxxxxx"
}


-- 
PJ O'Rourke  - "If government were a product, selling it would be illegal."
-- 
Per iscriversi  (o disiscriversi), basta spedire un  messaggio con OGGETTO
"subscribe" (o "unsubscribe") a mailto:linuxtrent-request@xxxxxxxxxxxxx


Other related posts: