|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Will You Use LINQ?So, VS2008 is now available (http://www.asp.net/). One thing I'm now
wondering about is how much sense LINQ makes. I've been reading of all the advantages of stored procedures: more secure, more efficient, and better organization of code associated with a database. To the extent that's true, it would seem better to avoid LINQ in favor of stored procedures. I'd be curious to hear others' take on this. Jonathan,
LINQ is a language thing. So I assume you are talking about LINQ to SQL which is an ORM product using LINQ. No, I won't be using LINQ to SQL for anything serious, but not because of stored procedures (which might be used nicely by LINQ to SQL) but because of these reasons: http://cs.rthand.com/blogs/blog_with_righthand/archive/2007/10/06/LINQ-to-SQL-showstoppers.aspx -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ Show quote "Jonathan Wood" <jw***@softcircuits.com> wrote in message news:Ouy0K2XMIHA.5140@TK2MSFTNGP05.phx.gbl... > So, VS2008 is now available (http://www.asp.net/). One thing I'm now > wondering about is how much sense LINQ makes. > > I've been reading of all the advantages of stored procedures: more secure, > more efficient, and better organization of code associated with a > database. To the extent that's true, it would seem better to avoid LINQ in > favor of stored procedures. > > I'd be curious to hear others' take on this. > > -- > Jonathan Wood > SoftCircuits Programming > http://www.softcircuits.com > Miha,
> LINQ is a language thing. So I assume you are talking about LINQ to SQL Actually, I was talking about LINQ in Microsoft languages such as C#. (Which > which is an ORM product using LINQ. is why I mentioned the release of VS2008, which includes support for this.) > No, I won't be using LINQ to SQL for anything serious, but not because of We may be talking about different things--I'm not sure. In the case of LINQ > stored procedures (which might be used nicely by LINQ to SQL) in C#, it would be replacing statements that could otherwise be in a stored procedure. I'm just wondering if that's a factor for anyone else. > but because of these reasons: Sheesh! Would it be possible for that guy to have any more typing errors? At > http://cs.rthand.com/blogs/blog_with_righthand/archive/2007/10/06/LINQ-to-SQL-showstoppers.aspx any rate, I have no idea what ORM is and I didn't really understand most of what he was saying. There's a slight possibility that item 6 and maybe item 2 might be related to the issue that I've raised. Thanks. Miha is not a native English speaker, so give him some slack on his English
diction. :-) An ORM is an Object Relational Mapper. It takes relational data, like a SQL Server table, and maps it to objects. That is basically what LINQ does, although I would not call it a true ORM. Where I believe LINQ shows promise is in the abstraction of the actual data store. In theory, you can write a query once and run it against XML, or SQL, or a variety of other sources. In practice, it is a bit more difficult than the marketing material, but this will improve. It also is very ORM like, as it creates objects from your data, but it is not what you find in traditional ORM products. Whether or not it makes sense to use it depends on your applications. If you are working internal applications and your company is fairly set on platform, you can probably wait. If you sell products that talk to a variety of stores, it might make sense. If you are not currently using business objects, LINQ can help. The downside Miha mentions in his blog post (n-tiers in specific) is partially a problem with the samples out there, as I believe one could design a decent enough n-tier structure around LINQ. I will agree, however, that the tools are far behind the technology. That is fairly typical of MS. Should you try LINQ? Sure. It is fun to play around with, if nothing else. And, you will likely learn some new things about programming, even if you do not adopt LINQ. If you take it deep enough to learn Lambda expressions, it is probably worth the trip, especially considering the likelihood the C# team will expand in the offering in the next version (a guess, but a good one). -- Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA ************************************************* Show quote | Think outside the box! | ************************************************* "Jonathan Wood" <jw***@softcircuits.com> wrote in message news:%23wH24ceMIHA.1204@TK2MSFTNGP03.phx.gbl... > Miha, > >> LINQ is a language thing. So I assume you are talking about LINQ to SQL >> which is an ORM product using LINQ. > > Actually, I was talking about LINQ in Microsoft languages such as C#. > (Which is why I mentioned the release of VS2008, which includes support > for this.) > >> No, I won't be using LINQ to SQL for anything serious, but not because of >> stored procedures (which might be used nicely by LINQ to SQL) > > We may be talking about different things--I'm not sure. In the case of > LINQ in C#, it would be replacing statements that could otherwise be in a > stored procedure. I'm just wondering if that's a factor for anyone else. > >> but because of these reasons: >> http://cs.rthand.com/blogs/blog_with_righthand/archive/2007/10/06/LINQ-to-SQL-showstoppers.aspx > > Sheesh! Would it be possible for that guy to have any more typing errors? > At any rate, I have no idea what ORM is and I didn't really understand > most of what he was saying. There's a slight possibility that item 6 and > maybe item 2 might be related to the issue that I've raised. > > Thanks. > > -- > Jonathan Wood > SoftCircuits Programming > http://www.softcircuits.com > Cowboy,
> Miha is not a native English speaker, so give him some slack on his Okay, well, I didn't initially realize it was his writing I criticized. And > English diction. :-) he looked English from his picture. So my apologies to Miha. > The downside Miha mentions in his blog post (n-tiers in specific) is I must confess I had trouble understanding him, perhaps in part due to my > partially a problem with the samples out there, as I believe one could > design a decent enough n-tier structure around LINQ. I will agree, > however, that the tools are far behind the technology. That is fairly > typical of MS. lack of knowledge on the subject. But you seem to be describing the exact same problem I was trying to describe in my initial post. While I focused on stored procedures, I guess n-tier is the issue I was trying to address. Above, you seem to be referring to the fact that you could put LINQ code in your data layer. But that still leaves stored procedures, which I'm understanding can be more efficient and secure than SQL queries from code. So I was looking at this as a problem with using LINQ. But, clearly, I need a better understanding of the subject. Thanks. "Jonathan Wood" <jw***@softcircuits.com> wrote in message LOL. Now I'll try to figure out whether this is a compliment or not :-)news:u5GoDHsMIHA.4196@TK2MSFTNGP04.phx.gbl... > Cowboy, > >> Miha is not a native English speaker, so give him some slack on his >> English diction. :-) > > Okay, well, I didn't initially realize it was his writing I criticized. > And he looked English from his picture. > So my apologies to Miha. Hey, no problem, I know my english is not perfect - feedback appreciated.-- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Jonathan Wood" <jw***@softcircuits.com> wrote in message LINQ is not database related in any way. ORM is. You are actually asking news:%23wH24ceMIHA.1204@TK2MSFTNGP03.phx.gbl... > Miha, > >> LINQ is a language thing. So I assume you are talking about LINQ to SQL >> which is an ORM product using LINQ. > > Actually, I was talking about LINQ in Microsoft languages such as C#. > (Which is why I mentioned the release of VS2008, which includes support > for this.) whether to use an ORM or not to use it. LINQ is used for all sort of queries thus you can't say should I use LINQ or stored procedures. > Only when you are using LINQ to SQL or forthcomming Entity Framework (or any >> No, I won't be using LINQ to SQL for anything serious, but not because of >> stored procedures (which might be used nicely by LINQ to SQL) > > We may be talking about different things--I'm not sure. In the case of > LINQ in C#, it would be replacing statements that could otherwise be in a > stored procedure. 3rd party ORM that features LINQ). I'm just wondering if that's a factor for anyone else. > Shees, that guy...I'll tell him.>> but because of these reasons: >> http://cs.rthand.com/blogs/blog_with_righthand/archive/2007/10/06/LINQ-to-SQL-showstoppers.aspx > > Sheesh! Would it be possible for that guy to have any more typing errors? At > any rate, I have no idea what ORM is and I didn't really understand most Items 2 and 6 are not related. 2 talks about n-tier (sending entities > of what he was saying. There's a slight possibility that item 6 and maybe > item 2 might be related to the issue that I've raised. between application domains) while 6 talks about executing database operations directly on database (i.e. UPDATE Customer SET Discount = Discount + 10) without need to load entity-modify it-save-it. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ Miha,
> LINQ is not database related in any way. ORM is. You are actually asking As stated in my previous post, I don't even know what ORM is. And, after > whether to use an ORM or not to use it. your reply, I still do not. Nor am I clear on "LINQ to SQL." I really don't know what you are talking about. LINQ is a form of SQL syntax that is used directly in a programming language. If you place SQL directly in your source code, then you are not placing it in a stored procedure. I don't get why you seem to resist that. >> Sheesh! Would it be possible for that guy to have any more typing errors? Sorry, didn't realize it was you. You really should proof read more though.> > Shees, that guy...I'll tell him. Jonathan,
You have asked a question in a subject and then have put text in the message that did not fit to each other. While in the message was: >>To the extent that's true, it would seem better to avoid LINQ in favor of You did not get an answer on the first question in the subject, because it stored procedures. is an impossible to answer question. Maybe can you ask in future to somebody. "Who did use LINQ?". You got your answers on the second question, therefore don't blaim Miha with what he wrote, your question in the subject is simple impossible to be answered. It is as a pot who calls a kettle black. Cor Show quote "Jonathan Wood" <jw***@softcircuits.com> schreef in bericht news:ep1x8phMIHA.4308@TK2MSFTNGP05.phx.gbl... > Miha, > >> LINQ is not database related in any way. ORM is. You are actually asking >> whether to use an ORM or not to use it. > > As stated in my previous post, I don't even know what ORM is. And, after > your reply, I still do not. Nor am I clear on "LINQ to SQL." I really > don't know what you are talking about. > > LINQ is a form of SQL syntax that is used directly in a programming > language. If you place SQL directly in your source code, then you are not > placing it in a stored procedure. I don't get why you seem to resist that. > >>> Sheesh! Would it be possible for that guy to have any more typing >>> errors? >> >> Shees, that guy...I'll tell him. > > Sorry, didn't realize it was you. You really should proof read more > though. > > -- > Jonathan Wood > SoftCircuits Programming > http://www.softcircuits.com > Are you suffering from some sort of mental disorder or something?
Who's blaming Miha for anything? I requested comments, and he gave some. And I'm just commenting back. You have some sort of problem with that? Show quote "Cor Ligthert[MVP]" <notmyfirstn***@planet.nl> wrote in message news:3385356D-A60D-44F9-9CF1-8703D2A966C3@microsoft.com... > Jonathan, > > You have asked a question in a subject and then have put text in the > message that did not fit to each other. While in the message was: > >>>To the extent that's true, it would seem better to avoid LINQ in favor of > stored procedures. > > You did not get an answer on the first question in the subject, because it > is an impossible to answer question. Maybe can you ask in future to > somebody. "Who did use LINQ?". > > You got your answers on the second question, therefore don't blaim Miha > with what he wrote, your question in the subject is simple impossible to > be answered. > > It is as a pot who calls a kettle black. > > Cor > > > > > "Jonathan Wood" <jw***@softcircuits.com> schreef in bericht > news:ep1x8phMIHA.4308@TK2MSFTNGP05.phx.gbl... >> Miha, >> >>> LINQ is not database related in any way. ORM is. You are actually asking >>> whether to use an ORM or not to use it. >> >> As stated in my previous post, I don't even know what ORM is. And, after >> your reply, I still do not. Nor am I clear on "LINQ to SQL." I really >> don't know what you are talking about. >> >> LINQ is a form of SQL syntax that is used directly in a programming >> language. If you place SQL directly in your source code, then you are not >> placing it in a stored procedure. I don't get why you seem to resist >> that. >> >>>> Sheesh! Would it be possible for that guy to have any more typing >>>> errors? >>> >>> Shees, that guy...I'll tell him. >> >> Sorry, didn't realize it was you. You really should proof read more >> though. >> >> -- >> Jonathan Wood >> SoftCircuits Programming >> http://www.softcircuits.com >> > > Are you suffering from some sort of mental disorder or something? In the way you did it, Yes.> > Who's blaming Miha for anything? I requested comments, and he gave some. > And I'm just commenting back. > > You have some sort of problem with that? > I am not the biggest friend with Miha, but the way you think that you are allowed to act is realy disguisting. People like you will make that people stop helping others. Cor I have absolutely no idea what the heck you are rambling on about. Anything
you interpreted as blaiming Miha is based on your misunderstanding (except for maybe his typing errors on his site). Miha didn't seem to have a problem with what I said. Although I didn't understand all that he said, I still the discussion was useful, for me anyway. So why don't you just go and mind your own business? Show quote "Cor Ligthert[MVP]" <notmyfirstn***@planet.nl> wrote in message news:6258A57D-62F9-4741-B38A-06F595E76D76@microsoft.com... > > >> Are you suffering from some sort of mental disorder or something? >> >> Who's blaming Miha for anything? I requested comments, and he gave some. >> And I'm just commenting back. >> >> You have some sort of problem with that? >> > > In the way you did it, Yes. > > I am not the biggest friend with Miha, but the way you think that you are > allowed to act is realy disguisting. > > People like you will make that people stop helping others. > > Cor "Jonathan Wood" <jw***@softcircuits.com> wrote in message Perhaps you should read definition from wikipedianews:ep1x8phMIHA.4308@TK2MSFTNGP05.phx.gbl... > Miha, > >> LINQ is not database related in any way. ORM is. You are actually asking >> whether to use an ORM or not to use it. > > As stated in my previous post, I don't even know what ORM is. And, after > your reply, I still do not. Nor am I clear on "LINQ to SQL." I really > don't know what you are talking about. http://en.wikipedia.org/wiki/Object-relational_mapping In short, ORM is a technique that maps database entities to objects that exist in programming world. IOW you operate with objects while ORM takes care of database interaction for you. Some ORM products out there: LLBLGenPro NHibernate, WilsonORMapper LINQ to SQL, Entitiy Framework (next year probably) .... While LINQ is a tecnique for querying everything that supports LINQ queries. LINQ by itself doesn't know what to do with databases. OTOH LINQ to SQL uses LINQ constructs to generate SQL queries. So when dealing with databases using LINQ you need an ORM product which knows how to transform LINQ queries into SQL queries. About the products listed above: some of them already support LINQ and some of them will soon support it (they have other way of expressing queries) - I think that no ORM will ignore LINQ. Hope this explanation clears the fog a bit. > Definitely not. As explained above, LINQ is in no way connected to SQL. ORM > LINQ is a form of SQL syntax that is used directly in a programming > language. If you place SQL directly in your source code, then you are not > placing it in a stored procedure. I don't get why you seem to resist that. (think LINQ to SQL) does the transformatino for you. Furthermore LINQ to SQL is capable of using stored procedures, so you can have both. And also, you could embed LINQ to SQL into managed stored procedures. > >>> Sheesh! Would it be possible for that guy to have any more typing >>> errors? >> >> Shees, that guy...I'll tell him. > > Sorry, didn't realize it was you. You really should proof read more > though. -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ Miha,
> Perhaps you should read definition from wikipedia It would've been quite difficult for me to do that not knowing what ORM > http://en.wikipedia.org/wiki/Object-relational_mapping stood for. > In short, ORM is a technique that maps database entities to objects that And so what is the "ORM" product involved in the latest .NET languages?> exist in programming world. IOW you operate with objects while ORM takes > care of database interaction for you. > Some ORM products out there: > LLBLGenPro > NHibernate, > WilsonORMapper > LINQ to SQL, > Entitiy Framework (next year probably) I want to be clear: All I've seen was a short video showing the new LINQ feature of VS2008 and C#. I thought I understood what it was. Perhaps I didn't. What it looked like was a way to duplicate SQL logic in the language proper. It seemed logical to conclude that any SQL logic placed within C#, for example, would therefore not be placed in a stored procedure, because a stored procedure would not be in C#. I'm still not clear where the flaw in that logic, if any, lies. > While LINQ is a tecnique for querying everything that supports LINQ I guess I figured that by specifically referring to the LINQ in the latest > queries. > LINQ by itself doesn't know what to do with databases. OTOH LINQ to SQL > uses LINQ constructs to generate SQL queries. > So when dealing with databases using LINQ you need an ORM product which > knows how to transform LINQ queries into SQL queries. > About the products listed above: some of them already support LINQ and > some of them will soon support it (they have other way of expressing > queries) - I think that no ORM will ignore LINQ. > Hope this explanation clears the fog a bit. version of .NET languages, I was being far more specific than the description above. >> LINQ is a form of SQL syntax that is used directly in a programming <shrug> I guess I'll need to do some more reading on LINQ in .NET.>> language. If you place SQL directly in your source code, then you are not >> placing it in a stored procedure. I don't get why you seem to resist >> that. > > Definitely not. As explained above, LINQ is in no way connected to SQL. > ORM (think LINQ to SQL) does the transformatino for you. > Furthermore LINQ to SQL is capable of using stored procedures, so you can > have both. And also, you could embed LINQ to SQL into managed stored > procedures. Thanks. Have not determined it yet.
The examples on the market are good at abstracting the query from the data access, but I can do the same with a factory pattern and have a nice n-tier setup. I like LINQ, in theory, but I am not sure how I can adapt it to fit the multi-tiered structures. And the bits I have seen showing how to use LINQ tend to mush the lines, which means I will have to adapt my design methodologies, compromise, flatten my design (probably not going to happen) or scrap LINQ. -- Gregory A. Beamer MVP, MCP: +I, SE, SD, DBA ************************************************* Show quote | Think outside the box! | ************************************************* "Jonathan Wood" <jw***@softcircuits.com> wrote in message news:Ouy0K2XMIHA.5140@TK2MSFTNGP05.phx.gbl... > So, VS2008 is now available (http://www.asp.net/). One thing I'm now > wondering about is how much sense LINQ makes. > > I've been reading of all the advantages of stored procedures: more secure, > more efficient, and better organization of code associated with a > database. To the extent that's true, it would seem better to avoid LINQ in > favor of stored procedures. > > I'd be curious to hear others' take on this. > > -- > Jonathan Wood > SoftCircuits Programming > http://www.softcircuits.com > |
|||||||||||||||||||||||