Can COM be used with Chain of Responsibility Pattern

50 views Asked by At

The idea is that there is a primary implementation of COM interface, which needs to handle different MIME types (MIME is just an example). Primary implementation handles several common MIME types that are expected to be on the customer site.

To handle new MIME type one has to implement the same COM interface, but only for that new MIME type (let's call it enhanced COM object). Client calls enhanced COM object first, which handles its MIME type or calls primary COM object if MIME type is not recognized. We can assume that the might be more than one enhanced COM implementation. Hence, there is a chain of responsibility.

Is COM chain-of-responsibility possible? Is it practical?

Thanks

1

There are 1 answers

0
Simon Richter On BEST ANSWER

In theory it could, but I think you might be better off with a Factory pattern here, which in COM can be implemented using Categories.