In APSIMX, the model hierarchy is primarily composed of IModel instances. Because Plain Old Class Objects (POCOs) cannot directly implement the IModel interface, they are wrapped in a ClassAdaptor instance.
To include a POCO in a simulation, it must be wrapped in a ClassAdaptor. The ClassAdaptor has a single property, Obj, which holds the reference to the actual POCO instance. This pattern allows POCOs to be serialized and deserialized within the .apsimx file format while maintaining the required IModel hierarchy.
{
"$type": "Models.Core.ClassAdaptor, Models",
"Obj": {
"$type": "APSIM.Soils.Organic, APSIM.Soils",
"FOMCNRatio": 40.0,
"Thickness": [...],
"Carbon": [...],
"SoilCNRatio": [...],
"FBiom": [...],
"FInert": [...],
"FOM": [...]
},
"Name": "ClassAdaptor",
"ResourceName": null,
"Children": [],
"Enabled": true,
"ReadOnly": false
}