views:

88

answers:

2

Okay, I'm accessing the fields of a data row inside a data set using indexers, but let's consider this as just a syntactical feature. Would you go so far and call it a duck typed thing that is reduced to getters and setters, in other words a data transfer object?

+2  A: 

Yes, it is. In fact, there's syntax in VB that makes it even more obvious. You can write:

Dim row As DataRow
row!Name = "Foo"     'same as row("Name")
Pavel Minaev
oh, nice... never heard about that before (but I don't usually code in VB anyway)
Thomas Levesque
same for me. And to be honest, this is one more reason for disliking VB ("VB.NET. Not since the Vikings named Greenland has there been such a marketing deception." - Juval Lowy)
Marc Wittke
@Marc, what's wrong with this particular feature? Note how it uses a distinct operator `!`, so there's no way to use this "accidentally". And I find it much more readable than canonical indexer form for cases like datasets and data readers.
Pavel Minaev
A: 

It can be.

A dictionary of strings can be one too.

recursive