Converters

Converters transform business objects to Strings (formatting) and Strings to business objects (unformatting). The difference between converters and formatters is that converters only format or unformat a given object (a typed data) that does not have to be in the context while formatters format, unformat, and apply decorators to a set of objects located in different contexts.

One responsibility of a property descriptor is to identify the converters for the business object. The converters belong to following categories:

Each type in the toolkit must support a default category converter because its validator uses it to validate typed data. The other converter categories are optional. A single instance of a converter may support more than one category of conversion, and if coded appropriately, can support all categories. The toolkit allows you to add categories if needed.

Converters use attributes (such as pattern) to perform the formatting and unformatting of an object. You can define the attributes using parameters (defined as key-value pairs) within the converter definition or you can define them in the owning property descriptor. The converter first looks for the required parameters in the property descriptor before looking in its own Hashtable for the required parameters.