Formatters are what the toolkit uses to exchange data between toolkit entities such as contexts and services. Each formatter converts a specific data item into a string representation of the data item and parses a string into a specific data item. In this way, the toolkit uses formatters to build messages to do things such as sending a transaction to the host, writing a journal record, or printing a form. Formatters enable applications to interact with many various entities without requiring changes to the application. For example, an application might use different formatters to send the same data to the electronic journal or to a financial printer.
The toolkit entities in the application logic layer, such as business processes and Single Action EJBs, use the CHA Formatter Service to invoke formatters, while the toolkit entities in the application presentation layer and the client, such as the Java(TM) client, access formatter directly.
To help the formatting process, the toolkit includes a set of formatters and a set of decorators: