Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6239987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:29:10+00:00 2026-05-24T11:29:10+00:00

I am working on a system that needs to exhibit these behaviours: Audit Trail

  • 0

I am working on a system that needs to exhibit these behaviours:

  1. Audit Trail
  2. Undo / Revert to a particular version (such an action will itself be audit logged)

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:

  1. Have a ChangeManager class based on the observer pattern
  2. Derive my objects from a base object that “wraps up” changes in a command pattern
  3. Notify the ChangeManager with the command object on any of the CRUD events

Note:
A ‘change’ Command will consist of:

  • an (ordered) collection of 2-tuples detailing the field change (prev, new)
  • id of user that made the change
  • timestamp of the change

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:29:12+00:00Added an answer on May 24, 2026 at 11:29 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are working on a booking system that needs to support split appointments. These
I'm currently working on an embedded system that needs to read keyboard input (Actually
I'm working on a system that was developed for linux and that needs the
I am currently working on a data management system that needs to calculate huge
I've been working on implementing a pretty complex system in JavaScript that needs to
I'm working on a project that needs a ratings system where they can rate
The project I'm currently working on needs to interface with a client system that
I am working on a WISE Installer that needs to run on Java Version
I'm working on a system that needs to keep a log of every view
I'm working on a system that needs to get a country code based on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.