We've been using the term "message" in quite a general sense - to represent data passing from one Jabber entity to another. In fact, as we'll see in Chapter 5, there are different types, and subtypes, of message—and each one has a certain role within the whole context of the Jabber protocol. These messaging types are sometimes referred to as elements, and there are three of them - <message/>, <iq/> and <presence/>. [1]
The <message/> element has five subtypes - normal, chat, groupchat, headline, and error, for example. The <iq/> and <presence/> elements also have subtypes to distinguish and describe their usage and context. (The <iq/> element has types get, set, result, and error, while the <iq/> element has types available and unavailable.) Furthermore, we already know that these elements can be extended using namespaces. Each type and subtype, and each of the pre-defined namespaces (those that begin 'jabber:') have been designed with specific scenarios in mind.
There's a certain amount of consideration to be given in this respect when designing our messaging solutions and applications; how should we employ the basic message types, and do we need to create our own custom extensions qualified by our own namespaces?
For the most part, the answers to these questions will depend on what sort of solution needs to be developed; however, it is also important to consider what support is already available 'off the shelf' in the form of Jabber clients. This is especially the case if the application is A2P or P2A. These Jabber clients provide varying levels of features supporting the different message types and subtypes. For example, WinJab (for Win32 platforms) and Jarl (cross-platform, written in Perl/Tk) both support the <message/> subtype headline and can display URL information, which typically comes attached to the message in a jabber:x:oob qualified extension, in a useful way. If you're writing a news headline alert mechanism, for example, you may want to consider aiming development with a target of WinJab or Jarl in mind; the alternative is to develop your custom news headline viewer client.
| [1] | Actually, there are four - but the fourth—<route/>— is only used by the server, to route messages between the various components. |