I have a class that uses a hierarchy structure:
Class
{
string Id;
string ParentId;
//... other properties around 30
Date ModifiedDate;
Date CreationDate;
}
We have some kind of audit trail but is something like:
AuditTrail
{
string ClassId;
Field FieldId; // with an enum for each property
string OldValue;
string NewValue;
Date Date;
}
Now the customer wants to see the hierarchy structure at some point in time. (a Class can have only one parent but it can have multiple children)
Example
A is parent for B and B is parent for C
on a point in time
D is the parent of C
For a date before the change the hierarchy should be A and B and C
For a date after the change the hierarchy should be A and B
Using the audit trail in the actual form would be a nightmare to determine the entire hierarchy at some point in time, so I though of storing the entire structure in an xml with a validity period. (The reason is that it needs only 4-5 properties to know at some point in time).
Are there other better solutions for storing the hierarchy changes
Class
means some kind ofDAO
. @Dan you should loog forevent sourcing
which me help you building your audit log.