{"comment":{"url":"https://api.github.com/repos/dagurval/bitcoinxt/comments/13122528","html_url":"https://github.com/dagurval/bitcoinxt/commit/408a1e0b7b5f08b8f2b31dad569539434f8e0982#commitcomment-13122528","id":13122528,"user":{"login":"zander","id":63063,"avatar_url":"https://avatars.githubusercontent.com/u/63063?v=3","gravatar_id":"","url":"https://api.github.com/users/zander","html_url":"https://github.com/zander","followers_url":"https://api.github.com/users/zander/followers","following_url":"https://api.github.com/users/zander/following{/other_user}","gists_url":"https://api.github.com/users/zander/gists{/gist_id}","starred_url":"https://api.github.com/users/zander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zander/subscriptions","organizations_url":"https://api.github.com/users/zander/orgs","repos_url":"https://api.github.com/users/zander/repos","events_url":"https://api.github.com/users/zander/events{/privacy}","received_events_url":"https://api.github.com/users/zander/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":"","commit_id":"408a1e0b7b5f08b8f2b31dad569539434f8e0982","created_at":"2015-09-08T21:21:32Z","updated_at":"2015-09-08T21:21:32Z","body":"The design that introduces an interface and two implementations looks overdesigned to me.\r\n\r\nThe decision is purely made based on one pointer being null. That pointer happens to be a member of your class.\r\nAs such the two methods can trivially do the checks in-place instead of at construction time.  This makes is also more self-contained because now the one that instantiates the wrapper is the one that decides which of the two implementations to create.\r\n\r\nInstead I'd suggest having the exception be thrown in the fetchUrl at the time the handle turns out to be null.\r\n\r\nInterestingly, this doesn't really have any effect on the unit test, which is because the unit test doesn't actually test anything curl related...  I'm a big fan of unit tests, but this one doesn't actually test any implementation at all :)"}}