W3C home > Mailing lists > Public > public-media-capture@w3.org > May 2013

RE: Questions/Comments on Media Stream Recording

From: Jim Barnett <Jim.Barnett@genesyslab.com>
Date: Fri, 24 May 2013 13:04:00 +0000
To: Adam Bergkvist <adam.bergkvist@ericsson.com>
CC: "Frederick.Hirsch@nokia.com" <Frederick.Hirsch@nokia.com>, "mandyam@quicinc.com" <mandyam@quicinc.com>, "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <57A15FAF9E58F841B2B1651FFE16D2810411A4@GENSJZMBX02.msg.int.genesyslab.com>
Adam,
  It's just a quibble about style.  When I used to program in C++, I was taught never to write code like:

   // or if you have a reference to the recorder you
   // can access it directly
   recStream = recorder.stream;

The idea was that accessing instance variables directly broke encapsulation, and that it was better to always use an accessor function:
    recStream = recorder.getStream()

So my question is whether we should add an accessor function like getStream() so that programmers do not have to access the .stream instance variable directly.  It's just a quibble (and I get the sense that such style questions aren't very important in the  JavaScript world.)

- Jim

-----Original Message-----
From: Adam Bergkvist [mailto:adam.bergkvist@ericsson.com] 
Sent: Friday, May 24, 2013 7:58 AM
To: Jim Barnett
Cc: Frederick.Hirsch@nokia.com; mandyam@quicinc.com; public-media-capture@w3.org
Subject: Re: Questions/Comments on Media Stream Recording

On 2013-05-23 15:10, Jim Barnett wrote:
> Adam,
> Yes, this is true.  However in some circles/languages it is considered 
> very bad style to access instance variables directly (particularly for 
> code outside the class).  Do we share this view?

I'm not sure I'm following. Do you mean it's bad style to access the stream from the recorder? Could you elaborate?

/Adam
Received on Friday, 24 May 2013 13:04:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:17 UTC