Re: renaming updateIce

On 30/04/2014 4:22 AM, Adam Bergkvist wrote:
> On 2014-04-30 07:26, Justin Uberti wrote:
>> Since RTCConfiguration is no longer solely about ICE, and we now have
>> PeerConnection.getConfiguration(), I propose that
>> PeerConnection.updateIce() be renamed to
>> PeerConnection.updateConfiguration(), or perhaps even
>> PeerConnection.setConfiguration().
>>
>> Any objections to this change?
>
> I support this.
>
> /Adam
>

I think setConfiguration(RTCConfiguration) is preferable in the sense 
that you don't want to end up with PeerConnection.getConfiguration() 
returning a value that doesn't actually correspond to the current 
PeerConnection state.

If you use the Builder design pattern, you could do even better:

   PeerConnection.getConfiguration().changeSomething().apply()

where PeerConnection.getConfiguration() returns a copy-on-write 
configuration object and apply() updates the PeerConnection, otherwise 
the object is discarded and never used.

Gili

Received on Wednesday, 30 April 2014 08:38:42 UTC