Thursday, September 22, 2005 |
|
|
In comments, Mark Mehelis asked some good questions re. LINQ:
- As far as I can tell the syntax between VB and C# is not the same.
Do you know why this is? Would it not be better to have this be consistent
accross the languages?
The syntax does indeed vary between languages. A consistent query
language would definitely have
been easier to learn, but what LINQ provides is a set of consistent query operators that can be incorporated into
languages in whatever way the language designer sees fit. This makes LINQ
slightly less teachable (it will vary from language to language) but perhaps
more appealing to language designers, since they aren’t forced to accept
a query language that differs from their own language design philosophy. Vick
(VB) is emphasizing familiarity and a SQL-like syntax, Hejlsberg (C#) is
emphasizing functional-style programming forms. This is also a good place to
point out that languages can use the underlying APIs even if they do not implement
language extensions.
- Is there some way to have all
your LINQ based access through a
repository of some type. It would be to easy to pepper queries
throughout your code making it a string pulling excersize when your
application gained some size.
This is an interesting idea. I haven’t worked with
actual LINQ code enough to actually wrap my head around how it affects coupling
and cohesion, so I don’t know. We don’t yet know what patterns are
productive in LINQ-using programs. Obviously, you could put all your queries in
a single class behind a façade and even put that class into its own
namespace / assembly. Would that be a good idea? Not sure.
- Also what happens when the underlying data structure in the DB changes?
Must you re-compile your code? recreate your classes and then change your
LINQ queries?
You definitely should not
have to recompile on a DB change, you almost certainly do if you’re
querying objects.
|
Thursday, September 22, 2005 7:37:04 AM (Hawaiian Standard Time, UTC-10:00) | Disqus link |
|
|
|
|
|
|
|
| Recently Published Articles |
|
|
|
|
|
|
|
| HI |
|
|
|
|
| Archive |
| September, 2008 (2) |
| August, 2008 (6) |
| July, 2008 (12) |
| June, 2008 (3) |
| May, 2008 (1) |
| April, 2008 (11) |
| March, 2008 (11) |
| February, 2008 (24) |
| January, 2008 (20) |
| December, 2007 (18) |
| November, 2007 (25) |
| October, 2007 (27) |
| September, 2007 (16) |
| August, 2007 (28) |
| July, 2007 (46) |
| June, 2007 (41) |
| May, 2007 (23) |
| April, 2007 (26) |
| March, 2007 (23) |
| February, 2007 (27) |
| January, 2007 (36) |
| December, 2006 (31) |
| November, 2006 (24) |
| October, 2006 (35) |
| September, 2006 (52) |
| August, 2006 (56) |
| July, 2006 (34) |
| June, 2006 (63) |
| May, 2006 (45) |
| April, 2006 (29) |
| March, 2006 (30) |
| February, 2006 (17) |
| January, 2006 (11) |
| December, 2005 (27) |
| November, 2005 (8) |
| October, 2005 (21) |
| September, 2005 (48) |
| August, 2005 (14) |
| July, 2005 (17) |
| June, 2005 (8) |
| May, 2005 (10) |
| April, 2005 (10) |
| March, 2005 (43) |
| February, 2005 (21) |
| January, 2005 (22) |
| December, 2004 (69) |
| November, 2004 (46) |
| October, 2004 (28) |
| September, 2004 (8) |
| August, 2004 (5) |
| July, 2004 (1) |
| June, 2004 (27) |
| May, 2004 (12) |
| April, 2004 (45) |
| March, 2004 (89) |
| February, 2004 (37) |
| January, 2004 (10) |
| December, 2003 (42) |
| November, 2003 (52) |
| October, 2003 (32) |
| September, 2003 (16) |
| August, 2003 (20) |
| July, 2003 (20) |
| June, 2003 (26) |
| May, 2003 (20) |
| April, 2003 (3) |
| March, 2003 (1) |
| February, 2003 (11) |
| January, 2003 (16) |
| December, 2002 (23) |
| November, 2002 (26) |
| October, 2002 (38) |
| September, 2002 (55) |
| August, 2002 (4) |
| July, 2002 (3) |
| June, 2002 (3) |
|
|
|
|