object relational mapping libraries for xmpp
play

Object Relational Mapping Libraries for XMPP Strict but easy XMPP - PowerPoint PPT Presentation

Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Object Relational Mapping Libraries for XMPP Strict but easy XMPP programming, comparing with traditional libraries Sergey Dobrov XMPP


  1. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Object Relational Mapping Libraries for XMPP Strict but easy XMPP programming, comparing with traditional libraries Sergey Dobrov XMPP Summit 14, Portland OR, 2013.

  2. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Table Of Contents Introduction 1 XML ORM Approach 2 XML Elements Dispatcher 3 Key points Errors Synchronous XMPP Current State 4 Implemented Features Where is it used? Comparing examples 5 Software Version Protocol JSON-XMPP (a bonus) 6 Contacts 7

  3. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts whoami –verbose XMPP fan, was developing stuff for fun since 2005 (games-plugins, transports, services etc.)

  4. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts whoami –verbose XMPP fan, was developing stuff for fun since 2005 (games-plugins, transports, services etc.) Founder of JRuDevels: small community of Russian XMPP devs

  5. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts whoami –verbose XMPP fan, was developing stuff for fun since 2005 (games-plugins, transports, services etc.) Founder of JRuDevels: small community of Russian XMPP devs Bombus, JAJC, J2J, Vacuum-IM...

  6. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts whoami –verbose XMPP fan, was developing stuff for fun since 2005 (games-plugins, transports, services etc.) Founder of JRuDevels: small community of Russian XMPP devs Bombus, JAJC, J2J, Vacuum-IM... JaWiki: large knowledge warehouse about XMPP in Russian.

  7. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts whoami –verbose XMPP fan, was developing stuff for fun since 2005 (games-plugins, transports, services etc.) Founder of JRuDevels: small community of Russian XMPP devs Bombus, JAJC, J2J, Vacuum-IM... JaWiki: large knowledge warehouse about XMPP in Russian. Habahaba, LiJ and other experimental services.

  8. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Why another library? XMPP is a beauty and complete platform to solve many problems but it can be hard for newbies to follow all the rules. It could be solved with some framework which will make some borders and dictate the good style.

  9. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Why another library? XMPP is a beauty and complete platform to solve many problems but it can be hard for newbies to follow all the rules. It could be solved with some framework which will make some borders and dictate the good style. There are libraries which provide abstraction level for application developers but there’s no abstractions to implement XEPs.

  10. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Why another library? XMPP is a beauty and complete platform to solve many problems but it can be hard for newbies to follow all the rules. It could be solved with some framework which will make some borders and dictate the good style. There are libraries which provide abstraction level for application developers but there’s no abstractions to implement XEPs. The quality of JS libraries is not satisfactory.

  11. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Table Of Contents Introduction 1 XML ORM Approach 2 XML Elements Dispatcher 3 Key points Errors Synchronous XMPP Current State 4 Implemented Features Where is it used? Comparing examples 5 Software Version Protocol JSON-XMPP (a bonus) 6 Contacts 7

  12. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Problems Despite of XML completeness and harmony it contains many hidden rocks for the newbie programmers which may lead to the serious architecture pitfalls:

  13. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Problems Despite of XML completeness and harmony it contains many hidden rocks for the newbie programmers which may lead to the serious architecture pitfalls: 1 Many new programmers think: “Ah! Will parse it with regexps and construct with concatenation”.

  14. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Problems Despite of XML completeness and harmony it contains many hidden rocks for the newbie programmers which may lead to the serious architecture pitfalls: 1 Many new programmers think: “Ah! Will parse it with regexps and construct with concatenation”. Will collide with XML Entities. 1 Will do the same work again and again. 2 Will not care of specific things like XML namespaces and 3 prefixes.

  15. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Problems Despite of XML completeness and harmony it contains many hidden rocks for the newbie programmers which may lead to the serious architecture pitfalls: 1 Many new programmers think: “Ah! Will parse it with regexps and construct with concatenation”. Will collide with XML Entities. 1 Will do the same work again and again. 2 Will not care of specific things like XML namespaces and 3 prefixes. 2 XML namespaces and prefixes. Often missed even when XML parser is used. 1

  16. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Problems Despite of XML completeness and harmony it contains many hidden rocks for the newbie programmers which may lead to the serious architecture pitfalls: 1 Many new programmers think: “Ah! Will parse it with regexps and construct with concatenation”. Will collide with XML Entities. 1 Will do the same work again and again. 2 Will not care of specific things like XML namespaces and 3 prefixes. 2 XML namespaces and prefixes. Often missed even when XML parser is used. 1 3 Even when XML parser is used it’s often an excessive work to construct elements.

  17. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts What can we do? Obvious things: 1 Invent another abstraction level to handle these problems: Parse and construct XML elements from and to programming 1 language’s usual data primitives.

  18. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts What can we do? Obvious things: 1 Invent another abstraction level to handle these problems: Parse and construct XML elements from and to programming 1 language’s usual data primitives. Validate elements providing ready to use general XMPP 2 specific validators to make the borders.

  19. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts What can we do? Obvious things: 1 Invent another abstraction level to handle these problems: Parse and construct XML elements from and to programming 1 language’s usual data primitives. Validate elements providing ready to use general XMPP 2 specific validators to make the borders. The most popular programming paradigm for now is object 3 oriented, so we need some ORM.

  20. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Simple Example Let’s analyze a usual XML Stanza: <message from=’juliet@example.com/balcony’ id=’ktx72v49’ to=’romeo@example.net’ type=’chat’> <body>Art thou not Romeo, and a Montague?</body> </message>

  21. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Possible Mapping How would we want to see it as object? message.from_ = JID(’juliet’, ’example.com’, ’balcony’) message.id = ’ktx72v49’ message.to = JID(’romeo’, ’example.net’) message.type_ = ’chat’ message.body = ’Art thou not Romeo, and a Montague?’ Note The “from” and “to” attributes are JID objects which can implement additional properties and methods such as bare() etc.

  22. Introduction XML ORM Approach Dispatcher Current State Comparing examples JSON-XMPP (a bonus) Contacts Twilix Message Let’s see how such object definition will be look like in Twilix. For the beginning, lets define the Element: class Message(VElement): Note VElement here is a Twisted’s Element subclass which has a metaclass which collects class’ fields and converts them into internal structures which will be used to parse and build elements. This idea was inspired from django forms and models. JSLiX has another approach here: it uses special objects called “definition” which describes stanzas in the same way. Given document and the definition, JSLiX can generate JS object by this definition and vice-versa: given object and definition it can generate a document.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend