The ClassLoader and *ModelFileDAO implementations do not currently deal appropriately with custom property classes or of:s. Here's the issue:
The current design walks axioms (including requires) on models it find()s from the ModelFileDAO
This requires ModelFileDAO to instantiate models (not just pass their plain-object spec up to the ClassLoader)
However, when ModelFileDAO invokes foam.core.Model.create(clsDef), it eventually gets around to adapting the propertiesAxiomArray; while adapting elements that have a class: that's not loaded yet, an error is thrown
It looks like properties, and anything else that can be specified with a custom class: need:
A way to add a new class-load-promise to the current chain of promises to be resolved on ModelFileDAO.find()
Some sort of upgrade() interface that allows placeholders to be upgraded. (Perhaps the AxiomArray controls the upgrade, and knows which placeholder to swap out?)
This allows the ModelFileDAO to return a model only after all its constituent parts are ready, and deals with the fact that the code "realizes" that the class is missing in the middle of synchronous Model.create().
The
ClassLoader
and*ModelFileDAO
implementations do not currently deal appropriately with custom property classes orof:
s. Here's the issue:requires
) on models itfind()
s from theModelFileDAO
ModelFileDAO
to instantiate models (not just pass their plain-object spec up to theClassLoader
)ModelFileDAO
invokesfoam.core.Model.create(clsDef)
, it eventually gets around toadapt
ing theproperties
AxiomArray
; while adapting elements that have aclass:
that's not loaded yet, an error is thrownIt looks like properties, and anything else that can be specified with a custom
class:
need:ModelFileDAO.find()
upgrade()
interface that allows placeholders to be upgraded. (Perhaps theAxiomArray
controls theupgrade
, and knows which placeholder to swap out?)This allows the
ModelFileDAO
to return a model only after all its constituent parts are ready, and deals with the fact that the code "realizes" that the class is missing in the middle of synchronousModel.create()
.