{"action":"created","issue":{"url":"https://api.github.com/repos/openregister/openregister-java/issues/48","repository_url":"https://api.github.com/repos/openregister/openregister-java","labels_url":"https://api.github.com/repos/openregister/openregister-java/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/openregister/openregister-java/issues/48/comments","events_url":"https://api.github.com/repos/openregister/openregister-java/issues/48/events","html_url":"https://github.com/openregister/openregister-java/pull/48","id":178880466,"number":48,"title":"Spike: introduce register abstraction","user":{"login":"philandstuff","id":581269,"avatar_url":"https://avatars.githubusercontent.com/u/581269?v=3","gravatar_id":"","url":"https://api.github.com/users/philandstuff","html_url":"https://github.com/philandstuff","followers_url":"https://api.github.com/users/philandstuff/followers","following_url":"https://api.github.com/users/philandstuff/following{/other_user}","gists_url":"https://api.github.com/users/philandstuff/gists{/gist_id}","starred_url":"https://api.github.com/users/philandstuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philandstuff/subscriptions","organizations_url":"https://api.github.com/users/philandstuff/orgs","repos_url":"https://api.github.com/users/philandstuff/repos","events_url":"https://api.github.com/users/philandstuff/events{/privacy}","received_events_url":"https://api.github.com/users/philandstuff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-23T13:39:52Z","updated_at":"2016-09-29T08:39:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openregister/openregister-java/pulls/48","html_url":"https://github.com/openregister/openregister-java/pull/48","diff_url":"https://github.com/openregister/openregister-java/pull/48.diff","patch_url":"https://github.com/openregister/openregister-java/pull/48.patch"},"body":"**DO NOT MERGE!** This PR, in its current form, introduces *painful* performance penalties.\r\n\r\nThis is an attempt to introduce interfaces `Register` and `RegisterReadOnly` that capture in one place the kinds of operations and queries you can do on a register. There is an implementation, PostgresRegister, which captures all of the existing behaviour.\r\n\r\nThe PostgresRegister is super inefficient because it goes back to INSERTing rows one-by-one rather than getting proper benefit from JDBC batch inserts. This could be improved by having the PostgresRegister batch things up internally in memory and periodically send stuff off in a batch insert operation.\r\n\r\nI think this leads to interesting questions about where database transactions get managed (in this object? in the consumer?).\r\n\r\nThoughts?\r\n"},"comment":{"url":"https://api.github.com/repos/openregister/openregister-java/issues/comments/250405590","html_url":"https://github.com/openregister/openregister-java/pull/48#issuecomment-250405590","issue_url":"https://api.github.com/repos/openregister/openregister-java/issues/48","id":250405590,"user":{"login":"philandstuff","id":581269,"avatar_url":"https://avatars.githubusercontent.com/u/581269?v=3","gravatar_id":"","url":"https://api.github.com/users/philandstuff","html_url":"https://github.com/philandstuff","followers_url":"https://api.github.com/users/philandstuff/followers","following_url":"https://api.github.com/users/philandstuff/following{/other_user}","gists_url":"https://api.github.com/users/philandstuff/gists{/gist_id}","starred_url":"https://api.github.com/users/philandstuff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philandstuff/subscriptions","organizations_url":"https://api.github.com/users/philandstuff/orgs","repos_url":"https://api.github.com/users/philandstuff/repos","events_url":"https://api.github.com/users/philandstuff/events{/privacy}","received_events_url":"https://api.github.com/users/philandstuff/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T08:39:07Z","updated_at":"2016-09-29T08:39:07Z","body":"> Is it correct that Register 'is a' ReadOnlyRegister? Could Register be a separate interface - maybe WritableRegister?\r\n\r\nI don't think it's incorrect in the sense of [Liskov substitutability](https://en.wikipedia.org/wiki/Liskov_substitution_principle). The intention is that a `RegisterReadOnly` is simply a read-only view on to a `Register`, much like `Collections.unmodifiableList()` offers a read-only view of a `List`.  Maybe this could be communicated better?\r\n\r\nWe could instead have independent \"read\" and \"write\" interfaces, but I think we'll soon get to a point where we'll need to consume both in one class. In particular, in the external representation spike, we want to write a bunch of items and entries and then read a root hash to assert that we've got the correct value."}}
{"actor":{"display_login":"philandstuff"}}