To declare typed data elements at configuration or installation time, modify the XML files using the CHA Editor or any ASCII editor. These typed data elements can be dynamically updated at runtime. Define typed data elements in the data definition file. The types definition file should only be used as a repository of generic types. The typed data elements defined in the data file can reference these generic types and override some of type generic properties depending on what the data element requires.
The following are example definitions of data elements as they might appear in a typed data definition file:
KeyedCollection kColl = (KeyedCollection) DSEType.readObject("Account"); kColl.setValueAt("accountBalance", new Float("200"));
Note To ensure optimum performance in the type instantiation process, all default descriptors for types should include the implClass attribute in their definition. The rest of descriptors should also have the implClass attribute defined although the system can get the implementation class from the default descriptor of the type identified by the refType attribute.
Example 3
Instantiate the myBalance typed data field defined in the data definition file and set its balance to 200.
Note All above codes are correct. If the parameter value is not expected, type validation raises an exception, specifying a type mismatch (NLS key is BASE009). However, if the parameter value is a String instance, the type converter unformats the String instance to an expected Java type, and then validates the value. This is why you can set a String value to a Currency data element.