Integrity Checking
Posted: Fri Aug 07, 2009 10:48 am
by Craig Shearer >> Wed, 18 Jul 2001 1:01:24 GMT
Greetings all...
Does JADE need an integrity checking mechanism? Some relational databases have integrity checking built in, meaning that the database enforces integrity automatically.
JADE has some integrity checking features - such as automatic inverses, parent-child relationships etc. Also, if you force all access to an object through methods, then much integrity checking can be done here. But, there are still potential holes that may not be able to be checked using existing mechanisms.
As an example, it's usually desirable to implement validation of an object in a method on that object's class, rather than in methods (usually on form classes) that maintain the object. This ensures that validation is the same for all users of the class. While one could write a validation method, it's up to the developer to remember that it must be called.
What I'd like to have is a facility to writing a method that checked the integrity of an object immediately before changes to that object were committed to the database. So, if I update a bunch of objects in a transaction, each object would have its checkIntegrity method automatically called (if one was implemented) immediately before the commit. This method would then have the ability to abort the transaction and raise an exception if all was not well.
What do others think of this?
Craig Shearer
--
Chief Architect
Helix Software Limited
http://www.helix.co.nz
craig.shearer@helix.co.nz
Phone: 025 936 334
Greetings all...
Does JADE need an integrity checking mechanism? Some relational databases have integrity checking built in, meaning that the database enforces integrity automatically.
JADE has some integrity checking features - such as automatic inverses, parent-child relationships etc. Also, if you force all access to an object through methods, then much integrity checking can be done here. But, there are still potential holes that may not be able to be checked using existing mechanisms.
As an example, it's usually desirable to implement validation of an object in a method on that object's class, rather than in methods (usually on form classes) that maintain the object. This ensures that validation is the same for all users of the class. While one could write a validation method, it's up to the developer to remember that it must be called.
What I'd like to have is a facility to writing a method that checked the integrity of an object immediately before changes to that object were committed to the database. So, if I update a bunch of objects in a transaction, each object would have its checkIntegrity method automatically called (if one was implemented) immediately before the commit. This method would then have the ability to abort the transaction and raise an exception if all was not well.
What do others think of this?
Craig Shearer
--
Chief Architect
Helix Software Limited
http://www.helix.co.nz
craig.shearer@helix.co.nz
Phone: 025 936 334