Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the requirement to implement some kind of dual inspection or four-eyes principle as a feature of my software, meaning that every change of an object done by user A has to be checked by user B.

A trivial example would be a publishing system where an author writes an article and another has to proofread it before it is published.

I am a little bit surprised that you find nearly nothing about it on the net. No patterns, no libraries (besides cibet), no workflow solutions etc.

Is this requirement really so uncommon? Or am I searching for the wrong terms?

I am not looking for a specific solution. More for a pattern or best practice approach.

Update: the above example is really trivial. Let's add some more complexity to it. The article has been published, but it now needs an update. Putting the article offline for the update is not an option, but the update has to be proof read, too.

share|improve this question
This is a very general requirement description, IMHO very fuzzy. What do you consider as "one object"? Can you give some real-world examples? And are you looking for solutions for a specific environment/framework? Desktop? Web? What else? – Doc Brown Jun 8 '12 at 10:03
I'd consider looking for something like audit trail, audit requirements... stuff like that. And maybe for change management – gnat Jun 8 '12 at 10:11
There are still a few concepts in this world trivial enough that nobody's bothered to give them a name and write 500-page books about them. This is one of them. – Blrfl Jun 8 '12 at 10:31
The GoF book is about design patterns, on an object oriented design level. What you are asking for is something on the level more comparable with Martin Fowler's Analysis patterns ( Perhaps you find something valueable for your requirement in the first article on his list. – Doc Brown Jun 8 '12 at 10:54
Fowler has published his analysis patterns in a different book "Analysis Patterns: Reusable Object Models",… , those book contains essentially the same as the on-line articles I linked to above. – Doc Brown Jun 8 '12 at 11:32

I am a little bit surprised that you find nearly nothing about it, [...] no workflow solutions [...]

Looking for "workflow framework" or "workflow engine" at google gives you some million hits. Add your favorite programming language like Java, C# or PHP to it and you will probably find some solutions for your environment.

Your requirement can be viewed as a formalized workflow, and when you are going to model it in some kind of software, you can indeed try to use a workflow engine for it. However, in many real-world cases it will be enough just to assign your data some kind of state information (for example, your document to be published could have the states "under construction", "written", "proof-read", and "published"; if you like, you can add some timestamp).

If that is all you need, and the communication between the author, the proof-reader and the publisher is not modeled in your software, then using a workflow engine for that requirement may be overkill.

Edit: when talking about proof-reading and publishing of documents: the keywords which will help you may be "document management systems (DMS)" and "enterprise content management (ECM)". There is a whole part of the software industry producing DMS and ECM systems. Most of them allow explicit modeling of such a workflow you described.

share|improve this answer
Yes, finding workflow solutions is easy. But if you search for worklfow patters, you will not find something like the four-eye-principle. Another problem are updates (as I tried to describe in my update): the first approved version has to stay in the system while the second version is in approve state. As I said - I am not looking for a solution (I have several in mind for that), but for patterns or best practices. – rdmueller Jun 8 '12 at 11:32
Your update does not make things any more complicate. Treat a second version of the doc just like a different document, so it has to follow the same order of states. My point is: as long as things are so simple, applying any pattern, framework, or workflow engine produces probably more problems than it will solve for you. – Doc Brown Jun 8 '12 at 11:39
If I treat is as another document, I have to keep a reference to the first document in order to replace it as soon as I get the approval... – rdmueller Jun 8 '12 at 11:53
@Ralf: you will have to keep a reference to your first version of the document, regardless if you are modeling state and workflow in your software or not. This is no additional requirement where a "workflow engine" would help. Of course, if you want to trigger some actions depending on a state change, then a framework may be helpful. There are, however, a whole bunch of ready-made products which support such kind of document management. See my edit. – Doc Brown Jun 8 '12 at 13:01

I have worked for organizations where there were code reviews. I have also worked for organizations where a configuration control board would not approve changes to the code base until there was a review, and testing. The workflow required these steps before the code could be moved from the development machine, to the testing machine, and then to the production machine.

Look for information regarding software development for the space program, and for critical industries like Nuclear power, or medical instruments.

share|improve this answer
I guess you missed the question - it was about not about "dual inspection" of code, but about writing programs for supporting dual inspection. – Doc Brown Jun 8 '12 at 10:47
The industries I cited do have these requirements for code development, checklist development, documentation development, procedure development. – mhoran_psprep Jun 8 '12 at 11:05
and those industries build software with specific features for dual inspection? For example, a text processor or a code editor or a version control system? That was what the question was about. – Doc Brown Jun 8 '12 at 11:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.