WebSphere MQ, Booch class diagrams, classes, Object Model, queue management classes, handling classes, item" /> Features of WebSphere MQ C++

 

Features of WebSphere MQ C++

WebSphere MQ C++ provides the following features:

The following Booch class diagrams show that all the classes are broadly parallel to those WebSphere MQ entities in the procedural MQI (for example using C) that have either handles or data structures. All classes inherit from the ImqError class (see ImqError), which allows an error condition to be associated with each object.

Figure 1. WebSphere MQ C++ classes (item handling)

Figure 2. WebSphere MQ C++ classes (queue management)

To interpret Booch class diagrams correctly, be aware of the following:

  • Methods and noteworthy attributes are listed below the class name.

  • A small triangle within a cloud denotes an abstract class.

  • Inheritance is denoted by an arrow to the parent class.

  • An undecorated line between clouds denotes a cooperative relationship between classes.

  • A line decorated with a number denotes a referential relationship between two classes. The number indicates the number of objects that can participate in a given relationship at any one time.

The following classes and data types are used in the C++ method signatures of the queue management classes (see Figure 2) and the item handling classes (see Figure 1):

  • The ImqBinary class (see ImqBinary), which encapsulates byte arrays such as MQBYTE24.

  • The ImqBoolean data type, which is defined as typedef unsigned char ImqBoolean.

  • The ImqString class (see ImqString), which encapsulates character arrays such as MQCHAR64.

Entities with data structures are subsumed within appropriate object classes. Individual data structure fields (see Appendix B. MQI cross reference) are accessed with methods.

Entities with handles come under the ImqObject class hierarchy (see ImqObject) and provide encapsulated interfaces to the MQI. Objects of these classes exhibit intelligent behavior that can reduce the number of method invocations required relative to the procedural MQI. For example, you can establish and discard queue manager connections as required, or we can open a queue with appropriate options, then close it.

The ImqMessage class (see ImqMessage) encapsulates the MQMD data structure and also acts as a holding point for user data and items (see Reading messages) by providing cached buffer facilities. We can provide fixed-length buffers for user data and use the buffer many times. The amount of data present in the buffer can vary from one use to the next. Alternatively, the system can provide and manage a buffer of flexible length. Both the size of the buffer (the amount available for receipt of messages) and the amount actually used (either the number of bytes for transmission or the number of bytes actually received) become important considerations.