This PR relates to issue 185 but shouldn't be used to close that issue, it should remain open, because this PR doesn't address any of the main issues in my latest comment on that issue.
This PR updates the model-extension-example to include a ParentChildAssociation entity type along with Person and Child types, as well as an example in the examples module called ParentChildAssociationFunction showing how to create the association in a type-safe way.
The ParentChildAssociationFunction is designed for use with MagmaCoreService.runInWriteTransaction(), but also, since it is a Function it can be composed together with other Functions to produce larger blocks of code that can be executed in single transactions if desired. (My other project calls this kind of Function an Executor).
This Function (aka Executor) pattern is a useful way to package up useful functionality into re-usable blocks that build parts of a High Quality Data Model (HQDM) in as type-safe a way as is possible with the current state of MagmaCore.
This PR relates to issue 185 but shouldn't be used to close that issue, it should remain open, because this PR doesn't address any of the main issues in my latest comment on that issue.
This PR updates the
model-extension-example
to include aParentChildAssociation
entity type along withPerson
andChild
types, as well as an example in theexamples
module calledParentChildAssociationFunction
showing how to create the association in a type-safe way.The
ParentChildAssociationFunction
is designed for use withMagmaCoreService.runInWriteTransaction()
, but also, since it is aFunction
it can be composed together with otherFunctions
to produce larger blocks of code that can be executed in single transactions if desired. (My other project calls this kind ofFunction
anExecutor
).This
Function
(akaExecutor
) pattern is a useful way to package up useful functionality into re-usable blocks that build parts of a High Quality Data Model (HQDM) in as type-safe a way as is possible with the current state of MagmaCore.