I am working on a ASP.NET web application and there was recently a need to dynamically generate columns.
I created a static class ColumnBuilder.cs
, which takes in an entity and returns an appropriate control such as DropdownList
, TextBox
, Checkboxes
, etc. All of the methods are static and work fine.
- Will there be any performance impact if I use static methods?
- Will there be any unexpected behavior for using static methods?
For example: if the ColumnBuilder
is being used by a lot of people (> 10000). If yes, how do I go about solving this?
public static class ColumnBuilder
{
public static WebControl BuildColumn(ColumnEntity columnObject)
{
switch(columnObject.DataType)
{
case "TextBox"://return a new textbox
break;
case "DropdownList"://return a new DropdownList
break;
}
}
}