I am working on a system that needs to exhibit these behaviours:
I have seen a slightly similar question here, but it deals with only part of what I'm trying to do. Further more, I want to capture the entire life cycle of an object (i.e. CRUD).
The way I intend to implement this is as follows:
Note: A 'change' Command will consist of:
This is just "off of the top of my head" - and there may be holes in the approach I am thinking of taking - I would appreciate some help from people who have implemented this sort of behaviour before, and also general advise, pros and cons on the approach I have outlined above - or maybe a better/alternative approach. A snippet or two to point me in the right direction will also be greatly appreciated!.
I will be using C# as the implementation language.
Different types of internal audits include compliance, operational, financial and information technology audits.
An audit trail is a series of records of computer events, about an operating system, an application, or user activities. A computer system may have several audit trails, each devoted to a particular type of activity.
An audit trail is a step-by-step record by which accounting, trade details, or other financial data can be traced to their source. Audit trails are used to verify and track many types of transactions, including accounting transactions and trades in brokerage accounts.
This is a rather complicated topic. There are a number of formal approaches.
From my perspective, I'd consider using "Event Sourcing". See here for further information:
http://martinfowler.com/eaaDev/EventSourcing.html
That will take care of populating a changelog and maintaining current state and gives you the ability to replay events to undo changes. There are entirely event driven architectures based around this such as CQRS:
http://martinfowler.com/bliki/CQRS.html
Another alternative is the command pattern, which allows undo but does not consume all the requirements above such as audit tracking. An example of the command pattern with undo is here:
http://mattberther.com/2004/09/16/using-the-command-pattern-for-undo-functionality
Hope this is helpful.
Edit: provide CQRS reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With