{"action":"created","issue":{"url":"https://api.github.com/repos/google/flatbuffers/issues/1207","labels_url":"https://api.github.com/repos/google/flatbuffers/issues/1207/labels{/name}","comments_url":"https://api.github.com/repos/google/flatbuffers/issues/1207/comments","events_url":"https://api.github.com/repos/google/flatbuffers/issues/1207/events","html_url":"https://github.com/google/flatbuffers/issues/1207","id":120905412,"number":1207,"title":"Proposal: Split C# / Java generated code into \"Builder\" and \"Access\" classes","user":{"login":"evolutional","id":2247662,"avatar_url":"https://avatars.githubusercontent.com/u/2247662?v=3","gravatar_id":"","url":"https://api.github.com/users/evolutional","html_url":"https://github.com/evolutional","followers_url":"https://api.github.com/users/evolutional/followers","following_url":"https://api.github.com/users/evolutional/following{/other_user}","gists_url":"https://api.github.com/users/evolutional/gists{/gist_id}","starred_url":"https://api.github.com/users/evolutional/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evolutional/subscriptions","organizations_url":"https://api.github.com/users/evolutional/orgs","repos_url":"https://api.github.com/users/evolutional/repos","events_url":"https://api.github.com/users/evolutional/events{/privacy}","received_events_url":"https://api.github.com/users/evolutional/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-08T01:02:02Z","updated_at":"2015-12-08T02:00:40Z","closed_at":null,"body":"Right now, the generated code for Monster highlights how complex a class can be. It also becomes difficult to use, with both construction and Get/Mutate access methods intermingled. These concerns are largely independent and in my view could be separated.\r\n\r\nI propose a breaking API change whereby we generate two classes; an XXXBuilder (eg: MonsterBuilder) class which would contain all the Start/End/Add methods that focus on construction of the buffer. The second class would be named XXX (eg: Monster) and would contain the runtime accessor/mutator methods.\r\n\r\nThoughts?"},"comment":{"url":"https://api.github.com/repos/google/flatbuffers/issues/comments/162734866","html_url":"https://github.com/google/flatbuffers/issues/1207#issuecomment-162734866","issue_url":"https://api.github.com/repos/google/flatbuffers/issues/1207","id":162734866,"user":{"login":"evolutional","id":2247662,"avatar_url":"https://avatars.githubusercontent.com/u/2247662?v=3","gravatar_id":"","url":"https://api.github.com/users/evolutional","html_url":"https://github.com/evolutional","followers_url":"https://api.github.com/users/evolutional/followers","following_url":"https://api.github.com/users/evolutional/following{/other_user}","gists_url":"https://api.github.com/users/evolutional/gists{/gist_id}","starred_url":"https://api.github.com/users/evolutional/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evolutional/subscriptions","organizations_url":"https://api.github.com/users/evolutional/orgs","repos_url":"https://api.github.com/users/evolutional/repos","events_url":"https://api.github.com/users/evolutional/events{/privacy}","received_events_url":"https://api.github.com/users/evolutional/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T02:00:40Z","updated_at":"2015-12-08T02:00:40Z","body":"It's not about allocation, more about usability. When I'm using the generated API (eg: monster), it's not as intuitive as I'd have liked. The \"XXXBuilder\" class would remain the same (eg: static methods, etc) but be a class in it's own right. This would bring the C#/Java APIs more in line with the C++/Python code which does have separate builder/accessors."}}