{"action":"closed","issue":{"url":"https://api.github.com/repos/CruxFramework/crux-widgets/issues/688","labels_url":"https://api.github.com/repos/CruxFramework/crux-widgets/issues/688/labels{/name}","comments_url":"https://api.github.com/repos/CruxFramework/crux-widgets/issues/688/comments","events_url":"https://api.github.com/repos/CruxFramework/crux-widgets/issues/688/events","html_url":"https://github.com/CruxFramework/crux-widgets/issues/688","id":93348666,"number":688,"title":"Improve the way that constructor parameters are called","user":{"login":"samuelcardoso","id":11760723,"avatar_url":"https://avatars.githubusercontent.com/u/11760723?v=3","gravatar_id":"","url":"https://api.github.com/users/samuelcardoso","html_url":"https://github.com/samuelcardoso","followers_url":"https://api.github.com/users/samuelcardoso/followers","following_url":"https://api.github.com/users/samuelcardoso/following{/other_user}","gists_url":"https://api.github.com/users/samuelcardoso/gists{/gist_id}","starred_url":"https://api.github.com/users/samuelcardoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuelcardoso/subscriptions","organizations_url":"https://api.github.com/users/samuelcardoso/orgs","repos_url":"https://api.github.com/users/samuelcardoso/repos","events_url":"https://api.github.com/users/samuelcardoso/events{/privacy}","received_events_url":"https://api.github.com/users/samuelcardoso/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/CruxFramework/crux-widgets/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/CruxFramework/crux-widgets/milestones/1","html_url":"https://github.com/CruxFramework/crux-widgets/milestones/5.4.0","labels_url":"https://api.github.com/repos/CruxFramework/crux-widgets/milestones/1/labels","id":1126252,"number":1,"title":"5.4.0","description":null,"creator":{"login":"thiagobustamante","id":10834356,"avatar_url":"https://avatars.githubusercontent.com/u/10834356?v=3","gravatar_id":"","url":"https://api.github.com/users/thiagobustamante","html_url":"https://github.com/thiagobustamante","followers_url":"https://api.github.com/users/thiagobustamante/followers","following_url":"https://api.github.com/users/thiagobustamante/following{/other_user}","gists_url":"https://api.github.com/users/thiagobustamante/gists{/gist_id}","starred_url":"https://api.github.com/users/thiagobustamante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiagobustamante/subscriptions","organizations_url":"https://api.github.com/users/thiagobustamante/orgs","repos_url":"https://api.github.com/users/thiagobustamante/repos","events_url":"https://api.github.com/users/thiagobustamante/events{/privacy}","received_events_url":"https://api.github.com/users/thiagobustamante/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"open","created_at":"2015-05-22T18:12:53Z","updated_at":"2015-12-18T15:58:29Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-07-06T18:49:49Z","updated_at":"2015-12-18T15:58:29Z","closed_at":"2015-12-18T15:58:29Z","body":"When I use a component that has a lot of parameters, it's not very usefull how I pass parameters to it. We should think in a solution to improve this.\r\n\r\n\r\n1) One of the idea is to use the build pattern to all the setters methods:\r\n\r\n```java\r\npublic MessageBox setButtonText(String btnText)\r\n\t{\r\n\t\thideButton.setText(btnText);\r\n\t\treturn this;\r\n\t}\r\n```\r\n\r\n2) The other idea is (for all of the other parameters that HAS to be in the constructor) we should build a DTO to group the same kind of information AND use the builder patter, like this:\r\n\r\n```java\r\n\tpublic static class MessageParam\r\n\t{\r\n\t\tprivate SafeHtml message;\r\n\t\tprivate MessageType type;\r\n\t\t\r\n\t\tpublic MessageParam setType(MessageType type) \r\n\t\t{\r\n\t\t\tthis.type = type;\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tpublic MessageParam setMessage(SafeHtml message) \r\n\t\t{\r\n\t\t\tthis.message = message;\r\n\t\t\treturn this;\r\n\t\t}\r\n\t}\r\n```"}}