Guidance on using sequences and arrays

I'm wondering if someone can provide me with some guidance wrt using sequences vs arrays? I'm currently working on a spec that allows a user agent to manage phone calls, which defines the following:

interface TelephonyManager {
readonly attribute Call[] calls;
…  
}

The items inside the array "calls" attribute are supposed to reflect the phone calls currently being managed by the user agent. The user agent pops/pushes items in and out that array over the lifecycle of the application.     

What I'm confused about is what does "readonly" mean in the above. Clearly, it means that the reference of the array in the attribute can't be changed - but what about the content of the array? Can a developer do the following:

telephony.calls.pop();
telephony.calls.push(SomeOldCallObj);

If so, that would obviously be bad. Would it then be appropriate to change the calls attribute to a sequence (i.e., sequence<Call> getCalls())?  

--  
Marcos Caceres

Received on Wednesday, 26 June 2013 10:16:07 UTC