1

This is basically a design question.I would like to know what is the best way to implement this.

I need to implement a maker-checker-approver functionality.One common way is like below:

If there is Employee entity then employee_mk and employee_app are the two tables which is structurally identically.So when new employee is created it goes to employee_mk table and wait for approval.Once it is approved by higher level user then it removes from employee_mk table and goes to employee_app table. So in short if there is modification it goes to customer_temp table and other user can't see change until it is verified by authorised user.

is there any other way to implement this? basically at one point of time there will be two values of fields of entity.What can be different ways other than mentioned above to implement and design this.

SCoder
  • 919
  • 2
  • 11
  • 26

1 Answers1

1

As long as there will never be two equal instances in both tables, you could replace it with a state column.

You can build views to be used that filter on the state. Newly added rows get a default state of 'to be approved'.

This way you will have the possibility to keep referential integrity and such.

If you want to be able to handle updates in the same way you would have more work, the state should than be part of the primary key.

Glenner003
  • 1,450
  • 10
  • 20
  • Thanks for your response.But this looks like to be a lot of effort using this approach.I mean maker checker is common functionality in different applications.Dont we have some standard best way to implement such thing. – SCoder Apr 14 '15 at 05:51