Separation of code logic into actual data structures. Best practics?

I have an application that loads a large amount of data into memory (this is because it needs to perform mathematical modeling on large data sets). This data comes from several database tables, which all relate to each other.

The rules for data consistency are quite complex, and finding all the relevant data requires quite hashes and other additional data structures for the data.

The problem is that this data can also be interactively changed by the user in the dialog box. When the user clicks the OK button, I want to perform all the checks to make sure that he did not enter any inconsistencies in the data. In practice, all data should be verified immediately, so I cannot update my data set step by step and perform checks one by one.

However, all of the verification code works with the actual data set loaded into memory and uses hashing and other data structures. This means that I have to do the following:

  • Retrieve custom changes from the dialog box
  • Apply them to a large dataset
  • Perform large data set validation
  • Discard all changes if validation fails

, , . , , , .

( , , ), , , , .

'application'?

+5
4

, , , , , , , .

ORM . - , :

  • ORM , , , "-" , . ACID , , , . , . , . , , .

  • , , . ( ). , .

EDIT: , , - . A A, , , , . , , A, A '. . , , , , . , , . . , , , A (A). , (, ). , . , , . A A ', , (A) A'. ( , A A ' , .) , , , (A), A, (A), , A.

, .

, , , . . A, A- > A ' . A. A A ', . , , . , .

+4

, , , , .

, , - " " . , , " " , - "" , , . , , ; "" , - .

+3

, , , . , . , , . , , . - , . () , . , , , Prolog. , chcecks .

0

It sounds like you have to move the rules, etc. to the database in which they are located using checks in our application. Instead, putting most of the logic, for example, into stored procedures that are executed when the user inserts values ​​that you could catch and discard invalid input. But I think you have every reason to keep everything in mind.

0
source

All Articles