Hey guys
I am moving all the sql code that is being done inside my programme out to
the database and having it all called through stored procedures in the
database. To me this is the best way to separate database coding from actual
programme coding. Right way forward? Yes, no? I think yes just want
confirmation before i start as its a big job.
Thanks 6 1105
Yes
Peter
"Daniel" <Da*****@vestryonline.comwrote in message
news:eX**************@TK2MSFTNGP04.phx.gbl...
Hey guys
I am moving all the sql code that is being done inside my programme out to
the database and having it all called through stored procedures in the
database. To me this is the best way to separate database coding from
actual programme coding. Right way forward? Yes, no? I think yes just want
confirmation before i start as its a big job.
Thanks
IMO, yes.
Historically, another big win was performance, but this has levelled a
bit since the RDBMS vendors are now better at caching and reusing
plans. It also removes the temptation to use string concatenation to
build your SQL (easy in C#, trickier [but very possible] in SQL) -
thus avoiding most injection vulnerabilities.
But for me - the main advantage is a layer of abstraction (via the SP
signature as an interface) between the layers; I can't accurately
count the number of times where I have been able to re-work the
database independently of the application by tweaking the SPs -
invaluable. Security is another biggie; your C# code can have access
to execute a reviewed, formalised SP, but not have (direct) access to
do *anything* on the same tables - makes it very hard to exploit via
direct DML operations. Of course, some "find" operations are best done
via dynamic SQL, which requires SELECT as a minimum.
Of course, this does mean you can't simply let DataSets roam rampant
anymore (default [self-building] adapters). For me this is a very good
thing. What I am interested in, however, is how this is going to hang
together with LINQ; as I understand it you can plumb LINQ all the way
to the database if you want... but personally, I don't *want* my
applications having this level of ability... I'm currently downloading
the CTP to see how it behaves in practice (at this early stage).
Marc
"Daniel" <Da*****@vestryonline.comwrote in message
news:eX**************@TK2MSFTNGP04.phx.gbl...
Yes, no?
Most definitely!
Daniel <Da*****@vestryonline.comwrote:
I am moving all the sql code that is being done inside my programme out to
the database and having it all called through stored procedures in the
database. To me this is the best way to separate database coding from actual
programme coding. Right way forward? Yes, no? I think yes just want
confirmation before i start as its a big job.
I would certainly avoid hard-coded SQL where possible, but I don't tend
to use SPs as much as ORM. There are definitely cases where SPs are the
way to go (in particular when you want manipulation done and it can all
be done within the database), along with the security point raised by
Marc, but for CRUD operations (especially where reading can involve
dynamic queries) ORM solutions can be fabulous.
(At this point I should say that almost all my experience with ORM is
using Hibernate for Java; however, it made what would have been an
almost impossible project feasible.)
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Just an additional: interoperability. Some of my work is nice
standalone .Net (etc) systems, but I also support a large coroporate
monolith that has grown organically over time. Sometimes these systems
are neatly packaged, but often (where sub-systems have been upgraded
individually due to complexity) the same database operations must
support .Net 2.0 (smart, web and rich clients), VB6 (rich and web),
Centura and (gulp - until frighteningly recently) Gupta 16-bit (not
sure "rich" is the right term, but you get the idea...).
In such a scenario, the abstraction of SPs makes this (just about)
viable, where-as I wouldn't trust the VB6 or Centura ORM offerings to
play nicely side-by-side. I also acknowledge that both Java and .Net
provide many proven ORM offerings, and in a green-field scenario (i.e.
where I don't need to back-port to VB6 or below) I am happy to
re-evaluate what role things like NHibernate and LINQ have to play.
So cheers for your thoughts, Jon - always a pleasure.
Marc
Marc Gravell <ma**********@gmail.comwrote:
Just an additional: interoperability. Some of my work is nice
standalone .Net (etc) systems, but I also support a large coroporate
monolith that has grown organically over time. Sometimes these systems
are neatly packaged, but often (where sub-systems have been upgraded
individually due to complexity) the same database operations must
support .Net 2.0 (smart, web and rich clients), VB6 (rich and web),
Centura and (gulp - until frighteningly recently) Gupta 16-bit (not
sure "rich" is the right term, but you get the idea...).
In such a scenario, the abstraction of SPs makes this (just about)
viable, where-as I wouldn't trust the VB6 or Centura ORM offerings to
play nicely side-by-side. I also acknowledge that both Java and .Net
provide many proven ORM offerings, and in a green-field scenario (i.e.
where I don't need to back-port to VB6 or below) I am happy to
re-evaluate what role things like NHibernate and LINQ have to play.
One interesting thing is that this goes both ways. In the project I was
thinking of, we *did* have a load of stored procs for a lot of the
"background work". Now, we only had one client platform (Java) but we
had to work on both Oracle and SQL Server. We spent *much* more time
porting the procs from SQL Server to Oracle than we did getting the
queries right on both of them (and on HSQL, our unit testing database
platform).
So cheers for your thoughts, Jon - always a pleasure.
Ditto :)
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John Davis |
last post by:
I want to add a "quick search" functionality in ASP or ASP.NET page. I heard
we can use Microsoft Indexing Service to accomplish the task, but not sure
how to do it. Is this the correct approach??...
|
by: DaVinci |
last post by:
I did a google web & group search and didn't find an answer to my
question so... here we go. Will try to keep it short. (I am not a
complete beginner but am still pretty low on the food chain).
...
|
by: aredo3604gif |
last post by:
On Sun, 10 Apr 2005 19:46:32 GMT, aredo3604gif@yahoo.com wrote:
>The user can dynamically enter and change the rule connection between
>objects. The rule is a "<" and so given two objects:
>a <...
|
by: earthlinkmail |
last post by:
....you experienced programmers of C; did you start with C? What course
of study did you pursue to get to where you are today? Would you
suggest starting with REALbasic first for a n00b? I am...
|
by: IamtheEvster |
last post by:
I'm working with a LAMP platform - PHP 5.1.4, MySQL 5.0.21, RedHat
Enterprise 4... Running Sendmail 8.x.
I'm using the PHP mail() function to send some confirmation emails out
when a user...
|
by: Chris Thomasson |
last post by:
<wkaras@yahoo.comwrote in message
news:1156863246.290976.191710@i3g2000cwc.googlegroups.com...
volatile has nothing to do with the memory model... Well, except in
Microsoft...
...
|
by: mailursubbu |
last post by:
Hi
How to write a program to get the factorial of 4096.
I am working on a Linux m/c.
Best Regards,
Subra
|
by: =?Utf-8?B?eFNBTkRJeA==?= |
last post by:
I cant get i tunes/ quicktime working on the computer,
I had both of these before but they are not working now for some
reason.
Advice given on Apple site was to uninstall and then install...
|
by: jacob navia |
last post by:
Buffer overflows are a fact of life, and, more specifically, a fact of
C.
All is not lost however. In the book
"Value Range Analysis of C programs" Axel Simon tries to establish a...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |