lundi 23 février 2015

What is SteppedPattern?


I read this article on Jon Skeet's blog where he delves into the topic of performance on object pooling & thread safety.


In the article he makes a reference to SteppedPattern:



Most of our formatting goes through something called SteppedPattern – that’s basically one multicast delegate (with lots of actions) for formatting, and a list of delegates for parsing.



He demonstrates the above-mentioned format method:



public string Format(TResult value)
{
StringBuilder builder = new StringBuilder();
// This will call all the actions in the multicast delegate.
formatActions(value, builder);
return builder.ToString();
}


I've never heard of the term before and can't really find any information available online for SteppedPattern (most searched have lead me to Wikipedia's Software design pattern page)


Does anybody have more information on SteppedPattern, specifically:



  • how it is defined, and

  • where it would be applied?





Aucun commentaire:

Enregistrer un commentaire