Skip to main content
Code Review

Return to Answer

replaced http://codereview.stackexchange.com/ with https://codereview.stackexchange.com/
Source Link

Response to a Comment

My comment:

Create a metadata class containing a superset of all the configuration properties. Pass a collection of that to the building method. Use constructors! Years later no one knows the correct setting combinations for ours. For complex properties - like a string CSV list to be parsed - write methods to encapsulate said concat & de-concatination. The future you will thank you. P.S. the "one method..." Keep the code modular, clear, etc. It's "OO all the way down". Ours set complex properties directly, in hundred plus instances, and it's a *&^$% to understand and maintain;

Response:

@radarbob - thanks a lot - do you think you would find the time to post it as an answer with some code examples? Not sure how a metadata class would look etc etc.. – Bartosz Mar 9 at 9:40 @radarbob - thanks a lot - do you think you would find the time to post it as an answer with some code examples? Not sure how a metadata class would look etc etc.. – Bartosz Mar 9 at 9:40


FilterRow class

These properties customize SQL that populates DataGrids and about a dozen other UI controls. Different controls use different property combinations while some properties are common to all. There are about 300 instances created throughout our code.

There is necessarily design infrastructure to make this work. For example note the enum use. There is a lot of base-class handling for sub-class instantiation overrides. Also subsequent sub-class' property value handling may be customized.

In our most awesome use of this, 3 simple overrides customizes a screen of complex Sort, Range, and Filtering options used for report generation.

dr.ColumnName = "a DB table column name";
dr.ColumnTableName = "a DB table name";
dr.ColumnDefaultValue = string.Empty;
dr.ColumnLabel = "A Column Heading";
dr.ColumnDataType = DataType.String.ToString();
dr.ColumnControlType = ControlType.ComboBox.ToString();
dr.ColumnOperator = SQLOperator.EQ.ToString();
dr.ColumnDefaultValue = "";
dr.ColumnChoices = colA, colB, Colc; // the SELECT columns
dr.ColumnHeader = Aae, Bee, Cee; // corresponding datagrid column headings
dr.ColumnGrouping = ReportGroupType.Filter.ToString();

Response to a Comment

My comment:

Create a metadata class containing a superset of all the configuration properties. Pass a collection of that to the building method. Use constructors! Years later no one knows the correct setting combinations for ours. For complex properties - like a string CSV list to be parsed - write methods to encapsulate said concat & de-concatination. The future you will thank you. P.S. the "one method..." Keep the code modular, clear, etc. It's "OO all the way down". Ours set complex properties directly, in hundred plus instances, and it's a *&^$% to understand and maintain;

Response:

@radarbob - thanks a lot - do you think you would find the time to post it as an answer with some code examples? Not sure how a metadata class would look etc etc.. – Bartosz Mar 9 at 9:40


FilterRow class

These properties customize SQL that populates DataGrids and about a dozen other UI controls. Different controls use different property combinations while some properties are common to all. There are about 300 instances created throughout our code.

There is necessarily design infrastructure to make this work. For example note the enum use. There is a lot of base-class handling for sub-class instantiation overrides. Also subsequent sub-class' property value handling may be customized.

In our most awesome use of this, 3 simple overrides customizes a screen of complex Sort, Range, and Filtering options used for report generation.

dr.ColumnName = "a DB table column name";
dr.ColumnTableName = "a DB table name";
dr.ColumnDefaultValue = string.Empty;
dr.ColumnLabel = "A Column Heading";
dr.ColumnDataType = DataType.String.ToString();
dr.ColumnControlType = ControlType.ComboBox.ToString();
dr.ColumnOperator = SQLOperator.EQ.ToString();
dr.ColumnDefaultValue = "";
dr.ColumnChoices = colA, colB, Colc; // the SELECT columns
dr.ColumnHeader = Aae, Bee, Cee; // corresponding datagrid column headings
dr.ColumnGrouping = ReportGroupType.Filter.ToString();

Response to a Comment

My comment:

Create a metadata class containing a superset of all the configuration properties. Pass a collection of that to the building method. Use constructors! Years later no one knows the correct setting combinations for ours. For complex properties - like a string CSV list to be parsed - write methods to encapsulate said concat & de-concatination. The future you will thank you. P.S. the "one method..." Keep the code modular, clear, etc. It's "OO all the way down". Ours set complex properties directly, in hundred plus instances, and it's a *&^$% to understand and maintain;

Response:

@radarbob - thanks a lot - do you think you would find the time to post it as an answer with some code examples? Not sure how a metadata class would look etc etc.. – Bartosz Mar 9 at 9:40


FilterRow class

These properties customize SQL that populates DataGrids and about a dozen other UI controls. Different controls use different property combinations while some properties are common to all. There are about 300 instances created throughout our code.

There is necessarily design infrastructure to make this work. For example note the enum use. There is a lot of base-class handling for sub-class instantiation overrides. Also subsequent sub-class' property value handling may be customized.

In our most awesome use of this, 3 simple overrides customizes a screen of complex Sort, Range, and Filtering options used for report generation.

dr.ColumnName = "a DB table column name";
dr.ColumnTableName = "a DB table name";
dr.ColumnDefaultValue = string.Empty;
dr.ColumnLabel = "A Column Heading";
dr.ColumnDataType = DataType.String.ToString();
dr.ColumnControlType = ControlType.ComboBox.ToString();
dr.ColumnOperator = SQLOperator.EQ.ToString();
dr.ColumnDefaultValue = "";
dr.ColumnChoices = colA, colB, Colc; // the SELECT columns
dr.ColumnHeader = Aae, Bee, Cee; // corresponding datagrid column headings
dr.ColumnGrouping = ReportGroupType.Filter.ToString();
Source Link
radarbob
  • 8.2k
  • 21
  • 35

Response to a Comment

My comment:

Create a metadata class containing a superset of all the configuration properties. Pass a collection of that to the building method. Use constructors! Years later no one knows the correct setting combinations for ours. For complex properties - like a string CSV list to be parsed - write methods to encapsulate said concat & de-concatination. The future you will thank you. P.S. the "one method..." Keep the code modular, clear, etc. It's "OO all the way down". Ours set complex properties directly, in hundred plus instances, and it's a *&^$% to understand and maintain;

Response:

@radarbob - thanks a lot - do you think you would find the time to post it as an answer with some code examples? Not sure how a metadata class would look etc etc.. – Bartosz Mar 9 at 9:40


FilterRow class

These properties customize SQL that populates DataGrids and about a dozen other UI controls. Different controls use different property combinations while some properties are common to all. There are about 300 instances created throughout our code.

There is necessarily design infrastructure to make this work. For example note the enum use. There is a lot of base-class handling for sub-class instantiation overrides. Also subsequent sub-class' property value handling may be customized.

In our most awesome use of this, 3 simple overrides customizes a screen of complex Sort, Range, and Filtering options used for report generation.

dr.ColumnName = "a DB table column name";
dr.ColumnTableName = "a DB table name";
dr.ColumnDefaultValue = string.Empty;
dr.ColumnLabel = "A Column Heading";
dr.ColumnDataType = DataType.String.ToString();
dr.ColumnControlType = ControlType.ComboBox.ToString();
dr.ColumnOperator = SQLOperator.EQ.ToString();
dr.ColumnDefaultValue = "";
dr.ColumnChoices = colA, colB, Colc; // the SELECT columns
dr.ColumnHeader = Aae, Bee, Cee; // corresponding datagrid column headings
dr.ColumnGrouping = ReportGroupType.Filter.ToString();
default

AltStyle によって変換されたページ (->オリジナル) /