<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 8, 2013 at 5:51 AM, <span dir="ltr"><<a href="mailto:alexl@redhat.com" target="_blank">alexl@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Alexander Larsson <<a href="mailto:alexl@redhat.com" target="_blank">alexl@redhat.com</a>><br>
<br>
This allows an event to be extended in a backwards compatible way (on<br>
the client side) by marking an argument with a since attribute.<br>
Any arguments with a since value later than then value of the message<br>
itself will be marked optional and the demarshaller will supply<br>
default values for these arguments.<br></blockquote><div><br></div><div>I'm really nervous about extending arguments events/requests like this. For one, there's no way in the wire protocol to specify how many arguments are coming. Technically, you can get around this by simply using the provided message size as you did below. However, what you have created (from a protocol perspective) is an arbitrary list of optional arguments, not versioned events. Also, it should be noted that defaults are a non-issue because, once the client and server agree on a version, the extra arguments will get disregarded on both sides.<br>
<br></div><div>From another angle, this is going to be a real problem in other languages. Yes, many other languages can have some form of function overriding. However, they are not all as forgiving as C when it comes to not specifying the correct number of arguments. In Java, for instance, this is going to cause huge problems because once a function is in an interface, you can only add functions (at which point, you have to implement them all). Also, finding and using the correct version is going to be a run-time headache. I don't think this is insurmountable, but it's certainly a pain.<br>
<br></div><div>In short, I think this is far too complex for what it achieves. In the case of scaling factor stuff, you can just do it with a second event.<br><br></div><div>Thanks,<br></div><div>--Jason Ekstrand<br>
</div></div></div></div>