|
I know what you mean by tried-and-true. To a degree, that's what I've been invoking. Developing web apps with the sql code in the database and the procedural code in the app is the way things have been done for a long time, and it still works just fine.
That said, I try to keep an open mind as new technologies come out so I don't miss anything worthwhile. Of course, I've also been in the biz long enough to know that every time you turn around MS is telling you to throw away what you used to do in favor of this new, shiny thing - which they'll in turn tell you to throw away next year. Consequently, I take all this stuff with a grain of salt.
|
|
|
|
|
While I would say you're not missing anything, my experience is that people who write SP's have really no good practices regarding re-use (I believe another person responded about the lack of re-use with SP's as well.) And the triggers can get huge, spaghetti code, and invariably have undocumented logic and special case handlers, often using hardcoded data values. It's a mess, and when you talk to the people managing the code, they invariably say, we know it's a mess but we've had to make all these patches without any budget to fix the real underlying problems. And why's that? Because that would require changes to application, and the app devs, that were outsourced to write the app to begin with, are no longer around and nobody knows how to make changes in THAT code base without breaking half a dozen other features. So, that describes my real-world experiences, and probably those of many other people.
Also (stepping down from my rant platform), what you're describing in both cases is a 2-tier environment in most cases: app talking directly to the database. I hope I never have to work in a 2-tier environment ever again, but most people don't understand the benefits of a 3-tier environment. First off, you can isolate the application from "the database business." The stuff that manipulates data in the database's representation (aka schema) rather than the application's model, which can be quite different (but I'm not saying anything you don't already know.) But, what I like to do is then choose whether something should be an SP, or the SQL can be auto-generated by the middle tier, or it pulls in additional metadata that supplements the DB schema for further automation, or, as a last resort, the code in the middle tier does some processing of the data in C# (or whatever.)
But it's hard to convince people to take the time to architect a 3-tier system in which most stuff can be handled by metadata (schema + domain-specific declarative stuff) and then leverage either the middle tier or the SP's for the stuff that doesn't fit.
So, the question, in my mind, isn't "what am I missing with SP's vs Linq vs EF?", but "why am I still stuck in a 2-tier development environment?"
Well, that's my somewhat ranty reply.
Marc
|
|
|
|
|
I'm totally with you conceptually, although the rather loose way I phrased things allowed you to make an incorrect assumption.
It doesn't matter if you have 2 tiers or 42 - ultimately, you have to talk to the database. When you do, you can write your queries in compiled code, be it a separate assembly, a web service, etc. or you can write them in stored procedures.
My point is that I don't see the benefit in writing queries in a compiled, procedural language as opposed to letting sql be sql and do what you pay it to do.
On the other hand, it sounds like using LING with non relational db stuff could be very handy indeed.
So, put down that flamethrower, son, and keep your hands where I can see them.
|
|
|
|
|
As someone who has worked as both a DBA and developer I have a pet theory about this development away from stored procedures.
Like you I tend to stick to stored procedures and pass the parameters through from the client.
I have noticed that DBA's have a tendency to lock down as much of the database as possible and in many companies a stored procedure needs to go through a thorough vetting process before it is allowed into the database.
So add to the project lifecycle the client and database qc procedures and you have a bit of a nightmare on your hands - plus if a stored procedure needs to be changed...
As a consequence developers will do what they can to find ways around this spanner in the works of their project.
So the developers decide to do away with stored procedures and do the heavy lifting at the client end because they can navigate around the whole DBA qc environment and consequently get their projects completed more quickly.
This is my pet theory based on experience in small and very large companies.
I tend to think that if a stored procedure is written well and the correct indexes and partitions are created on database tables there should be no real problem with data access bottlenecks.
The alternative is to do all this work on the client which is faster, development wise, and requires less database knowledge.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
I think your assessment is spot on. Since I tend to write about life in the real world and how to cope with all those pesky humans, this fits right in with my own perceptions as well.
Add the shiny factor to this and you have a powerful force for change, whether it's warranted or not.
|
|
|
|
|
GuyThiebaut wrote: do all this work on the client which is faster, development wise, and requires
less database knowledge.
The deuce you say.
|
|
|
|
|
I don't mean that everyone who uses the client side option knows less about databases.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
IMHO
If you are / have access to competent DB developers (i.e. you can write or have written good SQL stored procedures, can debug them and, if necessary, measure and tweak performance) then stored procedures are the way to go.
If you are scared of SQL, or are crap at it, have no idea what is efficient or not, can manage a quick select or insert butr quake at the sight of anything more complex, then you might be more comfortable writing C# or VB rather than SQL and let LINQ to SQL manage the SQL code for you.
I am with you on the SP front - I much prefer the separation of concerns - I can have my .Net devs write against what is to essentially an interface, and my DB developers concentrate on the DB.
IF a SP is inefficient, I can tinker with it, and test it independently of any .Net code, and redeploy it without the need to re-deploy any client side code.
With well constructed SPs I can even significantly change the underlying DB structure without worrying about changing any deployed .NET code.
And if it is more efficient to mangle the data in the application, I can still have an SP return a record set and use LINQ to POCO to do the mangling.
My first use of SPs was entirely due to security of the DB - access to which was restricted entirely to stored procedures, so even giving someone access to the DB server still only gave them access to the SPs - they couldn't even see the tables - let alone try to update them.
(AM I starting to sound religious enough?)
MVVM # - I did it My Way
___________________________________________
Man, you're a god. - walterhevedeich 26/05/2011
.\\axxx
(That's an 'M')
|
|
|
|
|
Yep, that's largely the way I've seen things as well.
|
|
|
|
|
FYI MacBook Air owners:
Quote: Apple has determined that certain 64GB and 128GB flash storage drives used in the previous generation of MacBook Air systems may fail. These systems were sold between June 2012 through June 2013.
MacBook Air Flash Storage Drive Replacement Program[^]
Kevin Priddle
Editor and Special Projects Manager | CodeProject & Developer Media
|
|
|
|
|
Thanks, will look into that tonight.
I'd rather be phishing!
|
|
|
|
|
Since Windows 7, when you run a disk cleanup and select Windows Update Cleanup (mostly after the service pack installation). It takes at-least an hour to cleanup. I can download and install the same update 10 times in that time.
Windows 8.1 just updated with today's launch. and I performed disk cleanup to free up 450 MB of disk space on 5 different computers, and it took 1.0 - 2.5 hours to cleanup with > 70% CPU utilization.
When you run disk cleanup, it scans your computer and then tells you how much space it is going to free. So I am guessing it creates some king of list. So why it takes to long to loop through the list and remove the files.
When they are going to fix this.
|
|
|
|
|
Rutvik Dave wrote: When they are going to fix this
Do not hold your breath. We are talking Microsoft.
|
|
|
|
|
Rutvik Dave wrote: When they are going to fix this. Doesn't sound broken to me. It's not something you do every day.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Eddy Vluggen wrote: Doesn't sound broken to me. It's not something you do every day.
omg! Look, what they did to you.
|
|
|
|
|
I've wondered about this and figured that they are doing a lot of checking and ACID type operations to make sure they don't brick the system if power is lost.
|
|
|
|
|
But the update is already applied, this is the cleaning process of temporary setup files, right?
|
|
|
|
|
It has to scrub the uninstall data from various places and what if one update is dependent on another update?
This is just one theory.
Do remember that Microsoft isn't known for it's speedy installs.
|
|
|
|
|
Update Cleanup? What's that? I never have run it, because the first thing I do is turn off automatic updates.
Marc
|
|
|
|
|
..which is why I burst out in laughter whenever a company starts on the subject of security
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
They probably create a restore point before deleting each file.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
185 sushi chefs walk into a bar.
|
|
|
|
|
I don't think so - they don't server their kind there!
Anything that is unrelated to elephants is irrelephant Anonymous ----- Do not argue with an idiot. He will drag you down to his level and beat you with experience Greg King ----- I always wanted to be somebody, but now I realize I should have been more specific. Lily Tomlin, Actress
|
|
|
|
|
..and say "Bartender! Show me some raw power, chop, chop!"
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
Sorry I cant serve you: You smell a little fishy to me....
|
|
|
|
|