<div dir="ltr">I ran into a similar type of issue recently. I discussed very briefly with John M. and William, and I think a good thing to do would be to hide the generic RegisterResource method, and only expose methods which take the interface types. This would convert these types of issues from runtime to compile-time bugs.<div><br></div><div>-</div><div>Katherine</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 19, 2015 at 10:48 AM, Nate Finch <span dir="ltr"><<a href="mailto:nate.finch@canonical.com" target="_blank">nate.finch@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Wayne and I (and Horacio for some of the time) wasted a few days trying to figure out a problem with the watcher we'd created. Turns out, the problem was a missing 's': <a href="https://github.com/natefinch/juju/commit/12ad8d64f26aca5541bbd0f0c10cd8b45bcbcc75" target="_blank">https://github.com/natefinch/juju/commit/12ad8d64f26aca5541bbd0f0c10cd8b45bcbcc75</a><div><br></div><div>Thanks to Dimiter and John Weldon for catching it last night.</div><div><br></div><div>The reason the code still compiled is because all the facade caller (rpc) stuff uses empty interfaces and reflection to do serialization/deserialization. This is, at some level, unavoidable. However, it's sort of our own fault, too, for naming two things so similarly in code that we <i>know</i> is not type safe.</div><div><br></div><div>Please try to avoid making two types with very similar names if they're commonly used for serialization, especially if they're long names that only differ at the end. It makes it way too easy for a typo to slip in and cause hard to find bugs.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Nate</div></font></span></div>
<br>--<br>
Juju-dev mailing list<br>
<a href="mailto:Juju-dev@lists.ubuntu.com">Juju-dev@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/juju-dev" target="_blank">https://lists.ubuntu.com/mailman/listinfo/juju-dev</a><br>
<br></blockquote></div><br></div>