You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Malcolm Edgar (JIRA)" <ji...@apache.org> on 2009/07/03 01:11:48 UTC
[jira] Created: (CLK-565) Provide Control builder / factory class
Provide Control builder / factory class
---------------------------------------
Key: CLK-565
URL: https://issues.apache.org/jira/browse/CLK-565
Project: Click
Issue Type: New Feature
Affects Versions: 2.1.0
Reporter: Malcolm Edgar
Using a factory or builder pattern to create controls is a great way to reduce the number of lines of code in an application and can also help standardize your application.
There are 2 common pattners for doing this, one is the factory pattern, for example:
Table sizesTable = new Table("sizes");
ControlFactory.addColumn(table, "label", "Metric");
ControlFactory.addColumn(table, "value");
The other is the builder pattern, for example:
Table sizesTable = TableBuilder.simpleBuilder("sizes").addColumn("label", "Metric").addColumn("value").build();
Both of these styles have pros and cons. Please see attached examples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CLK-565) Provide Control builder / factory class
Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Malcolm Edgar updated CLK-565:
------------------------------
Component/s: extras
> Provide Control builder / factory class
> ---------------------------------------
>
> Key: CLK-565
> URL: https://issues.apache.org/jira/browse/CLK-565
> Project: Click
> Issue Type: New Feature
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Malcolm Edgar
> Attachments: ControlFactory.java, TableBuilder.java
>
>
> Using a factory or builder pattern to create controls is a great way to reduce the number of lines of code in an application and can also help standardize your application.
> There are 2 common pattners for doing this, one is the factory pattern, for example:
> Table sizesTable = new Table("sizes");
> ControlFactory.addColumn(table, "label", "Metric");
> ControlFactory.addColumn(table, "value");
> The other is the builder pattern, for example:
> Table sizesTable = TableBuilder.simpleBuilder("sizes").addColumn("label", "Metric").addColumn("value").build();
> Both of these styles have pros and cons. Please see attached examples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (CLK-565) Provide Control builder / factory class
Posted by "Adrian A. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adrian A. reassigned CLK-565:
-----------------------------
Assignee: Adrian A.
> Provide Control builder / factory class
> ---------------------------------------
>
> Key: CLK-565
> URL: https://issues.apache.org/jira/browse/CLK-565
> Project: Click
> Issue Type: New Feature
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Malcolm Edgar
> Assignee: Adrian A.
> Attachments: ControlFactory.java, TableBuilder.java
>
>
> Using a factory or builder pattern to create controls is a great way to reduce the number of lines of code in an application and can also help standardize your application.
> There are 2 common pattners for doing this, one is the factory pattern, for example:
> Table sizesTable = new Table("sizes");
> ControlFactory.addColumn(table, "label", "Metric");
> ControlFactory.addColumn(table, "value");
> The other is the builder pattern, for example:
> Table sizesTable = TableBuilder.simpleBuilder("sizes").addColumn("label", "Metric").addColumn("value").build();
> Both of these styles have pros and cons. Please see attached examples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (CLK-565) Provide Control builder / factory class
Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-565?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Malcolm Edgar updated CLK-565:
------------------------------
Attachment: TableBuilder.java
ControlFactory.java
> Provide Control builder / factory class
> ---------------------------------------
>
> Key: CLK-565
> URL: https://issues.apache.org/jira/browse/CLK-565
> Project: Click
> Issue Type: New Feature
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Malcolm Edgar
> Attachments: ControlFactory.java, TableBuilder.java
>
>
> Using a factory or builder pattern to create controls is a great way to reduce the number of lines of code in an application and can also help standardize your application.
> There are 2 common pattners for doing this, one is the factory pattern, for example:
> Table sizesTable = new Table("sizes");
> ControlFactory.addColumn(table, "label", "Metric");
> ControlFactory.addColumn(table, "value");
> The other is the builder pattern, for example:
> Table sizesTable = TableBuilder.simpleBuilder("sizes").addColumn("label", "Metric").addColumn("value").build();
> Both of these styles have pros and cons. Please see attached examples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-565) Provide Control builder / factory class
Posted by "Adrian A. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12726834#action_12726834 ]
Adrian A. commented on CLK-565:
-------------------------------
TableBuilder looks nice because it allows a sort of "chaining", without changing the Table API.
I saw similar patterns, but the naming was a little different:
TableBuilder.simpleTable("sizes")....
So TableBuilder.xxxTable() instead of TableBuilder.xxxBuilder()....
ControlFactory on the other hand doesn't look to save much code.
> Provide Control builder / factory class
> ---------------------------------------
>
> Key: CLK-565
> URL: https://issues.apache.org/jira/browse/CLK-565
> Project: Click
> Issue Type: New Feature
> Components: extras
> Affects Versions: 2.1.0
> Reporter: Malcolm Edgar
> Attachments: ControlFactory.java, TableBuilder.java
>
>
> Using a factory or builder pattern to create controls is a great way to reduce the number of lines of code in an application and can also help standardize your application.
> There are 2 common pattners for doing this, one is the factory pattern, for example:
> Table sizesTable = new Table("sizes");
> ControlFactory.addColumn(table, "label", "Metric");
> ControlFactory.addColumn(table, "value");
> The other is the builder pattern, for example:
> Table sizesTable = TableBuilder.simpleBuilder("sizes").addColumn("label", "Metric").addColumn("value").build();
> Both of these styles have pros and cons. Please see attached examples.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.