CellML Discussion List

Text archives Help


[cellml-discussion] API: CellML structure change monitoring


Chronological Thread 
  • From: Andrew Miller <ak.miller AT auckland.ac.nz>
  • To: cellml-discussion AT cellml.org
  • Subject: [cellml-discussion] API: CellML structure change monitoring
  • Date: Mon, 7 Mar 2005 17:02:30 +1300
  • List-archive: <http://www.cellml.org/pipermail/cellml-discussion>
  • List-id: "For those interested in contributing to the development of CellML." <cellml-discussion.cellml.org>

One of the goals of the CellML API should probably be to allow several users
to
work on the same CellML model at the same time. This will allow for, for
example, editor and evaluator(e.g. integrator) components to be placed in the
same model.

To do this, however, it would often be necessary to register to receive
notifications whenever part of the model changed. It would probably be
convenient to split such changes into four categories...
1) XML Comment or whitespace changes(where this information is kept in the
representation).
2) Changes to metadata.
3) Changes to initial_value attributes.
4) Structural changes to the model(all changes that don't fit into the first 3
categories).

This way, components could cache information from the model and invalidate the
cache whenever changes that would cause it to give inaccurate results occur.
It
could also be used to track the "dirty" state of a model to determine if it
should be saved, and to perform lazy cloning(where the model is cloned by a
component, but only after someone else tries to change it). To support all
these, there would need to be "pre"-change and "post"-change notifications.

The natural way to do this would be to define an interface like this:
interface CellMLModelChangeListener
{
/**
* Called prior to changing the metadata.
* @param model The model being changed.
* @return True to allow the change, or false to block it.
*/
bool preChangeMetadata(CellMLModel model);
void postChangeMetadata(CellMLModel model);

bool preChangeInitialValue(CellMLModel model);
void preChangeIntialValue(CellMLModel model);

bool preChangeStructure(CellMLModel model);
void preChangeStructure(CellMLModel model);
};
On top of this, there would need to be a way to register that change
notifications are desired with the CellMLModel.

Best regards,
Andrew


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



  • [cellml-discussion] API: CellML structure change monitoring, Andrew Miller, 03/07/2005

Archive powered by MHonArc 2.6.18.

Top of page