| 28 | |
| 29 | '''Analysis of Behavior''' |
| 30 | |
| 31 | Let be an Entity, which has an Attribute like this: |
| 32 | |
| 33 | Entity[id:1, systemStatus:original, modifier:x] |
| 34 | Attribute[id:2, systemStatus:original, modifier:x] |
| 35 | |
| 36 | * Modification of an Entity |
| 37 | A modification on an Entity will create a copy of the edited entity and its corresponding attributes (and relations). The new copy will have the value “original” in systemStatus and the current time in modifier. In the old version will be change only the attribute systemStatus from “original to copy”. |
| 38 | |
| 39 | Entity[id:1, systemStatus:copy, modifier:x] |
| 40 | Attribute[id:2, systemStatus:copy, modifier:x] |
| 41 | |
| 42 | Entity[id:1, systemStatus:original, modifier:currentTime] |
| 43 | Attribute[id:2, systemStatus:original, modifier:currentTime] |
| 44 | |
| 45 | Both the table entity_attribute and the table_relation should not be changed. |
| 46 | |
| 47 | * Elimination of an Attribute |
| 48 | An elimination of an attribute will mean the following changes: |
| 49 | |
| 50 | Entity[id:1, systemStatus:copy, modifier:x] |
| 51 | Attribute[id:2, systemStatus:copy, modifier:x] |
| 52 | |
| 53 | Entity[id:1, systemStatus:original, modifier:currentTime] |
| 54 | |
| 55 | For this case both the table entity_attribute and the table_relation should not be changed, because the reference between the attribute and the entity is used by the previous versions. |
| 56 | |
| 57 | * Insertion of an Attribute |
| 58 | An insertion of an attribute will mean the following changes: |
| 59 | |
| 60 | Entity[id:1, systemStatus:copy, modifier:x] |
| 61 | |
| 62 | Entity[id:1, systemStatus:original, modifier:currentTime] |
| 63 | Attribute[id:2, systemStatus:original, modifier:currentTime] |
| 64 | |
| 65 | For this case is needing the insertion of a row in the table entity_attribute, which represents the relation between the entity and the new attribute. If the mentioned row exists already, do nothing. |