Depending on the incoming data, the class must provide some object that is configured depending on the incoming data. Is there any suitable pattern or will you have to do everything through a switch-case?

    1 answer 1

    I think a pattern builder will suit you.

    "Separates the construction of a complex object from its representation, so that the same design process can result in different representations."

    You can read here: Wiki