473,786 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sql / Dot Net General Discussion

Hi,

I wanted to start a general discussion more for getting some thoughts
on what other people think/practice out there just to see how far (if
at all) I'm off base on my own thoughts.

My primary experience is developing applications using VB or DotNet. I
have some sql skills but they are limited. In a previous company our
concept on SQL was that it was used for very simple work, (i.e. insert,
update, delete, select, etc). The applications we wrote did the bulk
of the work. We had very limited DTS's wrtten and stored procs were
very small.

In the company I've been working at for the last year, we have two
different mindsets on this issue (to be honest, the numbers of people
who feel like I do have dwindled, we've lost some of our DotNet
developers in the last few months). A very large amount of work is
being developed in SQL and even where our DotNet applications are
concerned, I have seen some push for putting a lot of the work into the
stored procs instead of having them be simplistic like I mentioned in
the previous paragraph. I have seen stored procs called by dot net
apps that call other stored procs, that call others, etc. Some of
these procs are like minature apps in of themselves.

I have a hard time wrapping my brain around why anyone would do this.
I believe that this type of design is problematic for maintainence at
the very least. But I would think it puts an unnecesary burden on SQL
too. I just don't know how to prove it. When I've mentioned this,
some of the feedback I get is that my concept would cause network
traffic that is unnecessary (i.e. multiple stored proc calls, etc).
Again, I am unsure how to test/verify such a claim.

I would think the best approach is to have your business logic stay in
DotNet if you have a DotNet app. Obviously if you have a process that
doesn't get put into an application at all, then I believe the logic
should stay in SQL. I do question the necessity of having that type of
work happen as often as I'm seeing it though. DotNet can be used to
write pretty much any type of application that you would do in SQL.

I'm curious as to how other groups approach this issue? Any feedback
at all - regardless of how it would be in regards to my own opinion on
this subject would be much appreciated.

Oct 20 '06 #1
2 1514
You know, this might be one of those "if what you have is a hammer,
everything looks like a nail" situations.

If what you have is a bunch of DBA's doing the software architecture,
they're going to be oriented towards doing the business logic with
constraints, triggers, and stored procedures, because that's what they know.
If what you have is a bunch of application programmers (C++, .Net languages,
etc.) they're going to want to do the business logic in the middle tier, and
use the data layer only for access and update and so forth, because that's
what they know.

I could go on at considerable length, and probably will if this turns into
an active thread, but for now...

Regards,
Tom Dacon
Dacon Software Consulting
"Doug" <dn******@dtgne t.comwrote in message
news:11******** **************@ f16g2000cwb.goo glegroups.com.. .
Hi,

I wanted to start a general discussion more for getting some thoughts
on what other people think/practice out there just to see how far (if
at all) I'm off base on my own thoughts.

My primary experience is developing applications using VB or DotNet. I
have some sql skills but they are limited. In a previous company our
concept on SQL was that it was used for very simple work, (i.e. insert,
update, delete, select, etc). The applications we wrote did the bulk
of the work. We had very limited DTS's wrtten and stored procs were
very small.

In the company I've been working at for the last year, we have two
different mindsets on this issue (to be honest, the numbers of people
who feel like I do have dwindled, we've lost some of our DotNet
developers in the last few months). A very large amount of work is
being developed in SQL and even where our DotNet applications are
concerned, I have seen some push for putting a lot of the work into the
stored procs instead of having them be simplistic like I mentioned in
the previous paragraph. I have seen stored procs called by dot net
apps that call other stored procs, that call others, etc. Some of
these procs are like minature apps in of themselves.

I have a hard time wrapping my brain around why anyone would do this.
I believe that this type of design is problematic for maintainence at
the very least. But I would think it puts an unnecesary burden on SQL
too. I just don't know how to prove it. When I've mentioned this,
some of the feedback I get is that my concept would cause network
traffic that is unnecessary (i.e. multiple stored proc calls, etc).
Again, I am unsure how to test/verify such a claim.

I would think the best approach is to have your business logic stay in
DotNet if you have a DotNet app. Obviously if you have a process that
doesn't get put into an application at all, then I believe the logic
should stay in SQL. I do question the necessity of having that type of
work happen as often as I'm seeing it though. DotNet can be used to
write pretty much any type of application that you would do in SQL.

I'm curious as to how other groups approach this issue? Any feedback
at all - regardless of how it would be in regards to my own opinion on
this subject would be much appreciated.

Oct 20 '06 #2
Hi Doug,
My primary experience is developing applications using VB or DotNet. I
have some sql skills but they are limited. In a previous company our
concept on SQL was that it was used for very simple work, (i.e. insert,
update, delete, select, etc). The applications we wrote did the bulk
of the work. We had very limited DTS's wrtten and stored procs were
very small.
I feel the same way as Tom on this point.
In the company I've been working at for the last year, we have two
different mindsets on this issue (to be honest, the numbers of people
who feel like I do have dwindled, we've lost some of our DotNet
developers in the last few months). A very large amount of work is
being developed in SQL and even where our DotNet applications are
concerned, I have seen some push for putting a lot of the work into the
stored procs instead of having them be simplistic like I mentioned in
the previous paragraph. I have seen stored procs called by dot net
apps that call other stored procs, that call others, etc. Some of
these procs are like minature apps in of themselves.
Again, I think Tom's on point here as well.
I have a hard time wrapping my brain around why anyone would do this.
I believe that this type of design is problematic for maintainence at
the very least.
If you are primarily a .NET developer, then it might be a maintenance problem
to enforce, in a database, a large number of business rules that are unrelated
to the entegrity of data. But if you are a DBA, then implementing any
business logic in managed code might be a maintenance nightmare for you.

Normally you have to be more concerned with the logic that is handled in the
database, as a code developer, than a DBA has to be concerned with the logic
written in managed code. This is because developers have to use the data from
the database in code, and so must be aware of the schema, format, data types,
constraints and any business rules that will be enforced that might affect the
known state of the data. DBAs need be concerned with connections to the
database and when, how and how often they will be used, but not necessarily
how the data will be used within the application. Of course, these ideas
apply only to segregated development scenerios where sticking to ones own tier
is enforced, but that is usually desireable if you have the means. i.e., DBAs
should concentrate on meeting the data requirements of the solution in terms
of performance, scalabilty and data integrity. They must be concerened with
when, how and how often the database will be queried but should have little
concern for what the application will do with the data that is returned,
effectively seperating the tiers and providing for more focused management of
one particular facet of the solution - the data. The business rules that DBAs
enforce in the database should, therefore, be directly related to the
integrity of the data, the quantity of the data, how/when the data will be
used and how often it will be used.

My point is that certain business rules must be enforced in the RDBMS, such as
those that help to define the entities, their relationships and the required
domain integrity. If they aren't enforced in the RDBMS, then you might as
well just use a flat-file ;)

If your DBAs are using triggers, procedures, functions, rules, data types and
constraints to ensure the integrity of data according to the business
requirements of the solution, then I think they are just doing their jobs. If
they are doing anything less or anything more than I think you should question
their motives (staff meeting :)

Requirements that aren't directly related to the integrity of data should
really be enforced in manage code. For one thing OOP is obviously more robust
and scalable for a number of reasons, so why enforce business rules that have
no relationship to the integrity of data in a database language such as T-SQL?
The common answer, as Tom stated, is that DBAs can read T-SQL but can't read
C#, for example. As a developer, you might have a hard time with T-SQL and
prefer C#. In an enterprise development scenerio, however, I think the ideal
situation is to use T-SQL for CRUD procedures and the enforcement of business
rules and requirements that are directly related to the maintenance of data
integrity at the entity, referential and domain levels, and to define any
other business requirements in managed code, whenever possible.

As an architect, use your own discression in choosing where to enforce
particular business rules that idle on that fine line between data-integrity
requirements and data-manipulation requirements, and remember that you can and
usually should enforce those requirements in managed code unless they neatly
fit into a trigger, IMO.

Of course we don't live in an ideal world and so I will acknowledge exceptions
to the thoughts I laid out above. Financial applications, for example,
commonly have mathematical requirements that one can benefit from using SQL
Server's built-in forumlas for standard deviation and even more complex
operations, especially because they are designed to be used in aggregation and
use sets as input. The database is obviously well-equipped to handle such
requirements that aren't related to the integrity of data. However, other
than certain mathematical requirements I'm having a hard time figuring out
good reasons to enforce business rules in the database. And executing
mathematical formulas in the database isn't always the best choice anyway, but
it will never hurt to implement it in managed code.
But I would think it puts an unnecesary burden on SQL
too. I just don't know how to prove it.
You can't really burden an SQL Server with business rules if they are rules
that enforce or maintain entity, domain or referential data entegrity because
that's what an RDBMS does. I think other rules should normally be enforced in
code, as I mentioned above. Certain rules not related to data at all could
also be implemented in the database when automation through scheduling is
required. Enforcing these rules within SQL Server is not a burden, especially
since SQL Server provides robust support for this secondary functionality.

In SQL Server 2005 you can even execute managed code, so the lines are
beginning to blur anyway ;)
When I've mentioned this,
some of the feedback I get is that my concept would cause network
traffic that is unnecessary (i.e. multiple stored proc calls, etc).
Again, I am unsure how to test/verify such a claim.
Well you shouldn't need to test that comment at all. If the database is
processing most of the business rules of your application, the only calls that
you'll need to make are those for CRUD operations (ideally). Instead, if the
application is enforcing most of the business rules then the application will
most likely have to make extra calls to the database to enforce constraints,
format data and will definatly have to update multiple tables for reasons
other than simple CRUD operations. Yes, the latter will probably increase
network traffic greatly and that's why the RDBMS aspects of SQL Server should
be used to serve their purpose, reducing the amount of work the application
has to perform when enforcing data-centric business constraints and
requirements; however, I don't think that is a good excuse at all for
implementing business requirements that aren't related directly to the
integrity of the data, in the database. By doing so you may be reducing
network traffic but you are certainly creating more work by not leveraging the
benefits of an OOP environment and will definately not be able to address all
of the business requirements in the RDBMS alone, creating an illogical
seperation of certain rules making it confusing to figure out or remember
whether a rule was implemented in the database or in managed code, or even
where it may have been implemented in the database itself, such as triggers,
multiple procedures or functions. It's much easier, IMO, to find a business
rule in a self-titled business entity object than to search through a list of
155 stored procedures with a terrible naming convention (let's face it, no
matter what naming convention you choose it's always terrible when you have
155 or more stored procedures listed sequentially in a TreeView ;)
I would think the best approach is to have your business logic stay in
DotNet if you have a DotNet app. Obviously if you have a process that
doesn't get put into an application at all, then I believe the logic
should stay in SQL. I do question the necessity of having that type of
work happen as often as I'm seeing it though. DotNet can be used to
write pretty much any type of application that you would do in SQL.
I hope I've made my opinion on this clear :)

<snip>

--
Dave Sexton
Oct 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
10851
by: galina betz | last post by:
Please help! Getting this error intermittently: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
39
2395
by: Hareth | last post by:
C# 2005 express & vb 2005 express: 1. During runtime, I can edit my codes in C#..... How come this cannot be done in VB? it says ...."read-only" during runtime...... 2. Why does vb automatically show the errors, but C# i have to build the app b4 errors are underlined in my code?
8
1248
by: Smkmdb1 | last post by:
Hi everyone, I'm a student of ASP.net. Being an ex Perl/CGI programmer who made extra cash making scripts and selling them on the web, I was wondering if one typically uses this format with ASP.net? Do people typically follow the paradigm of making your software and selling the actual scripts/software (as was common with Perl/CGI), or do people typically use this to develop "service" oriented software, such as a developer hosting a...
6
2901
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There may be an upcoming vote on this, so please stay informed and read news.newgroups.announce for updates. Also see message <2uu44nF2eodc0U1@uni-berlin.de> for an example of the proponent's temperament.
4
1341
by: Phill W. | last post by:
Is there anything amiss with the newsgroup microsoft.public.dotnet.vb.general ?? From where I'm sitting, it's /completely/ dried up - only four posts in as many days. Did I miss the mass exodus, or is my news server simply messing me about?
94
4777
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring that I found inside of a string. Any ideas?
29
2945
by: Dexter | last post by:
This Java based utility may be invoked from Java code to parse mathematical expressions. It is useful for programmers developing calculators, graphing utilities or other math related programs. Download for free at http://www.thinkanddone.com/prog/java/parser.html If the above link does not work try http://www.britishcomputercolleges.com/prog/java/parser2.html
3
1624
by: =?Utf-8?B?Ymxi?= | last post by:
I am posting to the general discussion group - but I cannot find my postings... or replies...
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.