jeudi 18 janvier 2018

Design pattern to apply a set of operations on an object

I'm looking for a specific design pattern that is used to implement function composition. The goal is to be able to pass an object that represents a set of operations applied on a specific sequence to a client, and let the client apply the operations without caring what they might be. The pattern covers the following requirements:

  1. needs to apply an operation to an input (i.e., maps a given input to an output)
  2. operations must be composable
  3. each operation can be applied in isolation or composed with other operations

Requirement #1 sounds like a strategy pattern or command pattern, while requirement #2 brings the composite design pattern to mind.

Does anyone know if there's a OO design pattern that fits these requirements?

Aucun commentaire:

Enregistrer un commentaire