What is a name of that pattern ? I guess, it's a factory, but i am not sure.
using System.Windows.Forms;
public class TreeNodeHelper
{
public TreeNode GetTreeNodeType1()
{
return new TreeNode("type1");
}
public TreeNode GetTreeNodeType2()
{
return new TreeNode("type2");
}
// etc
}
TreeNodeHelper class returns different instances of TreeNode. It only returns TreeNodes instances and nothing else.