{"action":"created","issue":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/758","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/758/labels{/name}","comments_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/758/comments","events_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/758/events","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/758","id":94372035,"number":758,"title":"Discussion: Builder.reset() and from(X) everywhere or nowhere","user":{"login":"ST-DDT","id":1579362,"avatar_url":"https://avatars.githubusercontent.com/u/1579362?v=3","gravatar_id":"","url":"https://api.github.com/users/ST-DDT","html_url":"https://github.com/ST-DDT","followers_url":"https://api.github.com/users/ST-DDT/followers","following_url":"https://api.github.com/users/ST-DDT/following{/other_user}","gists_url":"https://api.github.com/users/ST-DDT/gists{/gist_id}","starred_url":"https://api.github.com/users/ST-DDT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ST-DDT/subscriptions","organizations_url":"https://api.github.com/users/ST-DDT/orgs","repos_url":"https://api.github.com/users/ST-DDT/repos","events_url":"https://api.github.com/users/ST-DDT/events{/privacy}","received_events_url":"https://api.github.com/users/ST-DDT/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/labels/input%20wanted","name":"input wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"gabizou","id":1203877,"avatar_url":"https://avatars.githubusercontent.com/u/1203877?v=3","gravatar_id":"","url":"https://api.github.com/users/gabizou","html_url":"https://github.com/gabizou","followers_url":"https://api.github.com/users/gabizou/followers","following_url":"https://api.github.com/users/gabizou/following{/other_user}","gists_url":"https://api.github.com/users/gabizou/gists{/gist_id}","starred_url":"https://api.github.com/users/gabizou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabizou/subscriptions","organizations_url":"https://api.github.com/users/gabizou/orgs","repos_url":"https://api.github.com/users/gabizou/repos","events_url":"https://api.github.com/users/gabizou/events{/privacy}","received_events_url":"https://api.github.com/users/gabizou/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones/4","html_url":"https://github.com/SpongePowered/SpongeAPI/milestones/Revision%203.0","labels_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/milestones/4/labels","id":1082492,"number":4,"title":"Revision 3.0","description":"This is the third stable revision of the Sponge API, 3.0 ","creator":{"login":"Zidane","id":744482,"avatar_url":"https://avatars.githubusercontent.com/u/744482?v=3","gravatar_id":"","url":"https://api.github.com/users/Zidane","html_url":"https://github.com/Zidane","followers_url":"https://api.github.com/users/Zidane/followers","following_url":"https://api.github.com/users/Zidane/following{/other_user}","gists_url":"https://api.github.com/users/Zidane/gists{/gist_id}","starred_url":"https://api.github.com/users/Zidane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zidane/subscriptions","organizations_url":"https://api.github.com/users/Zidane/orgs","repos_url":"https://api.github.com/users/Zidane/repos","events_url":"https://api.github.com/users/Zidane/events{/privacy}","received_events_url":"https://api.github.com/users/Zidane/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":80,"state":"open","created_at":"2015-04-24T16:02:08Z","updated_at":"2015-12-06T23:13:17Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-07-10T19:11:57Z","updated_at":"2015-12-06T23:15:03Z","closed_at":null,"body":"While digging through the API I found lots of `Builder`s that have a `reset()` method but i also found a lot of `Builder`s that don't have such a method.\r\nA few `Builder`s also provide a method `from(template)` which behaves quite similar while others have a method `getBuilderFrom(template)` to obtain a new templated builder.\r\n\r\n**`Builder`s without `reset()`**\r\n* org.spongepowered.api.effect.particle.ParticleEffectBuilder\r\n* org.spongepowered.api.item.inventory.custom.CustomInventoryBuilder\r\n* org.spongepowered.api.item.recipe.ShapedRecipeBuilder\r\n* org.spongepowered.api.item.recipe.ShapelessRecipeBuilder\r\n* org.spongepowered.api.util.command.CommandResult.Builder\r\n* org.spongepowered.api.util.command.args.CommandFlags.Builder\r\n* org.spongepowered.api.util.command.spec.CommandSpec.Builder\r\n* ...\r\n\r\n**`Builder`s with `reset()`**\r\n* org.spongepowered.api.attribute.AttributeBuilder\r\n* org.spongepowered.api.attribute.AttributeModifierBuilder\r\n* org.spongepowered.api.data.ImmutableDataBuilder<H, E>\r\n* org.spongepowered.api.item.FireworkEffectBuilder\r\n* org.spongepowered.api.item.inventory.ItemStackBuilder\r\n* org.spongepowered.api.item.merchant.TradeOfferBuilder\r\n* org.spongepowered.api.potion.PotionEffectBuilder\r\n* org.spongepowered.api.world.gen.populator.*.Builder\r\n* ...\r\n\r\nThere should be a common decision for our entire project whether our builders should have a `reset()` method or not. \r\nThe same for `from(template)` methods.\r\nIs there a common practise or coding guideline?\r\n\r\nPro `reset()`/`from(tempalte)`\r\n* Do not have to leak an entire service or the `GameRegistry` to a method where only a `Builder` is needed more than once.\r\n* Lesser object creation and thus less garbage collection.\r\n\r\nCons:\r\n* ?"},"comment":{"url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/comments/162364827","html_url":"https://github.com/SpongePowered/SpongeAPI/issues/758#issuecomment-162364827","issue_url":"https://api.github.com/repos/SpongePowered/SpongeAPI/issues/758","id":162364827,"user":{"login":"gabizou","id":1203877,"avatar_url":"https://avatars.githubusercontent.com/u/1203877?v=3","gravatar_id":"","url":"https://api.github.com/users/gabizou","html_url":"https://github.com/gabizou","followers_url":"https://api.github.com/users/gabizou/followers","following_url":"https://api.github.com/users/gabizou/following{/other_user}","gists_url":"https://api.github.com/users/gabizou/gists{/gist_id}","starred_url":"https://api.github.com/users/gabizou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabizou/subscriptions","organizations_url":"https://api.github.com/users/gabizou/orgs","repos_url":"https://api.github.com/users/gabizou/repos","events_url":"https://api.github.com/users/gabizou/events{/privacy}","received_events_url":"https://api.github.com/users/gabizou/received_events","type":"User","site_admin":false},"created_at":"2015-12-06T23:15:03Z","updated_at":"2015-12-06T23:15:03Z","body":"This will require another extensive change of `ResettableBuilder` to be more generic."}}