GX model constructor deprecated
The best way to create an instance of a GX model is to call the create
static method. It is not a best practice to call the GX model constructor that uses the
new keyword and that takes an object parameter. Hence,
Guidewire is deprecating the constructor. The GX model create() method uses
the following syntax:
var xmlInst = YOURPACKAGE.MODELNAME.TYPENAME.create(object)An
example of a call to the create() method is as
follows:var modelSysB = com.mycompany.addressmodel.Address.create(myAddress, {labelSysB})The deprecated constructor call uses the following
syntax:
var xmlInst = new YOURPACKAGE.MODELNAME.TYPENAME(object)An example of a call to this constructor is as
follows:
var xmlAddressData01 = new com.mycompany.addressmodel.Address(myAddress)Guidewire recommends that customers use the create method instead of the constructor taking an object parameter. This constructor will still exist for creating a GX model object, but Guidewire discourages its use. Consistent with deprecating the constructor, Guidewire is removing instructions and examples that call it.
