mercredi 23 décembre 2020

Name of pattern

May be wrong place to ask (please direct) but:

I often use a variance of the Strategy pattern where I write like this:

interface IA
{
   bool CanHandle(T someParameter)
   void Handle(T someParamter)
}
class A1:IA {}
class A2:IA {}

I then have a class where IEnumerable<IA> is injected, the First/Single/All of the instances is found through CanHandle() and called on Handle().

IS there a name for this pattern?

Aucun commentaire:

Enregistrer un commentaire