We want a processing function to be added to a system dynamically, without changing the assembly software. There is a need to test the assembly code independent of the processing software. Assembly and downstream processing may be developed by separate, often non-collocated groups. The assembly system should be developed assuming nothing of the downstream processing. By providing a facility to set handlers to be invoked when a complete unit is available for processing, we are able to isolate the assembly software from the processing software.
Virtual functions help make the details of the assembly operation transparent.
This is similar to a callback pattern, where a handler is specified to an object to be called when an event occurs, but the motivation differs. The emphasis in this pattern is on providing a way to allow teams of developers to decouple their work. The classes representing the units of work that the assembly software processes have a method to set a handler which will be called when the unit is complete. The units of work can be individual data objects or objects created by assembling objects from a data stream. Only units which interest the client will be sent to it.