Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Many different input, single type output design pattern

Does such design pattern exists? It is similar but opposite to a factory pattern. The factory accepts a single input (e.g. type A) and creates a variant output (e.g. type X or Y or Z), depending on the input.

The pattern I'm thinking accepts various different types of input (e.g. type X or Y or Z) but produces only a single type of output (e.g. type A). What pattern is this, if it exists?

like image 903
jasonline Avatar asked May 10 '26 05:05

jasonline


1 Answers

That's not a pattern per se, but rather it would require implementing the Adapter pattern as appropriate.

like image 175
Ignacio Vazquez-Abrams Avatar answered May 12 '26 10:05

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!