abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garrett Rooney" <roo...@electricjellyfish.net>
Subject Re: Coding/Language Standards
Date Thu, 28 Sep 2006 15:45:25 GMT
On 9/28/06, Harris Boyce III <harris.r.boyce.iii@gmail.com> wrote:
> Right and I think this is where the rub lies.  I've been "brought-up"
> that, unless the data is read-only, you just generally implement
> read/write properties so I can easily implement it as:
>
> List<Entry> Entries {
>   get;
> }
>
> But even with that, nothing prevents the user accessing the feed from
> calling theFeed.Entries.Add(someEntry);  Now, the implementation could
> return a read-only List and then any modifying operations would
> generate exceptions.  But...why would I do that?
>
> Does that make any sense?  I'm hoping that this doesn't seem like an
> immature conversation, but it's one that I struggle with when I study
> Java.  Why wouldn't I just use those conveience methods to modify the
> list if and when I need to do so?
>
> Thanks again for the discussion!  I'm learning lots!

I wouldn't object to returning read-only lists in that sort of
situation.  Heck, I wouldn't object to doing so in Java either ;-)

-garrett

Mime
View raw message