Re: [ACTION-43] (sdp related objects and global namespace) - way forward

On 2012-06-14 16:38, Harald Alvestrand wrote:
> On 06/14/2012 12:06 PM, Adam Bergkvist wrote:
>> Hi
>>
>> I got the task to drive action ACTION-43: Move SessionDescription and
>> IceCandidate out of the global namespace.
>>
>> I'm not really sure how to resolve this. As I understood it, the
>> concern was that, e.g., that the name SessionDescription is to general
>> to be in the global namespace. There's also the argument that
>> SessionDescription never will be used outside the context of
>> PeerConnection. However, we have other stuff that is strictly
>> PeerConnection related but lives in the global namespace (e.g. events).
>>
>> Ways forward:
>>
>> 1. Prefix the name with PeerConnection.
>>   * PeerConnectionSessionDescription
>>    - Still in the global namespace but a less general name.
>>
>> 2. Add, e.g., SessionDescription to the PeerConnection namespace.
>>   * PeerConnection.SessionDescription
>>    - Does any other web API do this?
>>
>> Downside with the two above is a very long name and, unlike e.g.
>> PeerConnectionErrorCallback, the name will be used by developers to
>> construct objects.
> Where?
> If there is no "new" operator, developers will never use the full name.

Both SessionDescription and IceCandidate currently have constructors. We 
could remove those and have a static factory function on PeerConnection.

I don't think

var desc = pc.createSessionDescription(str);

makes sense since the function doesn't need anything from the pc instance.

>>
>> 3. Come up with a new shorter name that less general and keep the
>> objects in the global namespace.
>>   * PeerSessionDescription
>>   * PeerMediaDescription
>>    - SessionDescription doesn't mean that much to the average web
>>      developer so we could go with Media instead to make the usage
>>      clearer.
> Neither 1 nor 3 move them out of the global namespace.

I don't see moving them out of the global namespace as the only solution 
to this problem (even though that's how the action was formulated). 
We're already putting a lot of stuff in the global namespace with 
PeerConnection prefixes. Renaming was also discussed during the meeting.

/Adam

Received on Thursday, 14 June 2012 14:55:25 UTC