I'm trying to figure out the name behind this design pattern. Basically, you have some arbitrary data that needs to be processed, and any arbitrary number of "handler" objects that may be capable of handling the data. The data gets passed to these handlers until something processes it.
For example, in Qt, QImage reads images via QImageReader. QImageReader queries QImageIOHandler objects to see if the given file format can be read by that QImageIOHandler. If so, it uses that handler to read the image.
Is there a name for this delegation of responsibility?
A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. It also gives implementation hints and examples.
As per the design pattern reference book Design Patterns - Elements of Reusable Object-Oriented Software , there are 23 design patterns which can be classified in three categories: Creational, Structural and Behavioral patterns. We'll also discuss another category of design pattern: J2EE design patterns.
Chain of Responsibility
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