Saturday, September 20, 2014

XMPP learning - Framework Main components



The XMPP framework started out in 2008 with an RFC 3920. Some of the common features that are on top of xmpp are roasters, capabilities and Hundreds of XEPs. But this initial version had only a handful of features such as messaging, presence and iq. Though the code was compiled into objective C, it required more code from many developers to make use of the full functionalities of XMPP. 

The framework has two parts 

1. The xmpp core
2. The extensions (roster, XEP's, optional supporting utilities etc)

The xmpp core is an implementation of RFC 3920. An important concept to be understood is, we should not confuse between XMPP and chat. XMPP is a generic protocol that can be used for many purposes. There are many companies that use this protocol for tasks such as home automation and delivering code blue alarms to nurses in hospital. The details of the XMPP indicates that eXtensible Messaging and Presence Protocol. 

XMPP core 
The main files in the core are 
XMPPStream, XMPPParser, XMPPJID, XMPPElement, XMPPIQ, XMPPMessage, XMPPPresence, XMPPModule, XMPPLogging, XMPPInternal. 

The heart of the framework is XMPPStream class. This is the class primarily the application will interact with and this is class that all extensions and custom code will plug into. 
XMPParser is an internal class used by XMPPStream. 

XMPPJID provides an immutable JID (Jabber Identifier) implementation. It support parsing of JIDs and extracting various parts of the JID in various forms. It conforms to the NSCopying protocol so that the JID may be used as is as Keys in NSDictionary. It even conforms to the NSCoding protocol. 

XMPPelement is the base class for 3 primary XMPP elements. XMPPIQ, XMPPMessage, XMPPPresence, 

XMPPModule provides a foundation class for optional pluggable extensions. If a developer is writing own specific code, then it can be register to this and declared to get events. However, if building self a standard XEP, or if want application specific extensions to be pluggable, then the developer will be building atop XMPPModule. 

XMPPLogging provides a very flexible, fast and powerful logging framework . 

XMPPInternal is just internal stuffs related to the core and various advanced low-level extensions. 

References:

No comments:

Post a Comment