473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DAL or BOL? Can someone clarify?

Hi all,

I was wondering about where this code should go.

Basically i have several tables in my database, when i add a row to a
particular table, i will need to also add other entries in other
tables.

I would consider this to be code that should be in the BOL? Am i right
in thinking that?

The same if i was deleting records in the database, if a record is
deleted from one table, i need to also delete other entries in other
tables, BOL or DAL?

My database is setup with relationships so SQL will report errors on
foreign keys that cannot be deleted, so this is the one reason why i
thought it may go in the DAL, but then again, it is a business rule,
that if one row is deleted in one table, other row in other tables
should be deleted.

Can someone please let me know, or pass an article for me to read.

Cheers

Sep 20 '06 #1
2 1854
"Nemisis" <da*********@hotmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
I was wondering about where this code should go.

Basically i have several tables in my database, when i add a row to a
particular table, i will need to also add other entries in other
tables.

I would consider this to be code that should be in the BOL? Am i right
in thinking that?

The same if i was deleting records in the database, if a record is
deleted from one table, i need to also delete other entries in other
tables, BOL or DAL?

My database is setup with relationships so SQL will report errors on
foreign keys that cannot be deleted, so this is the one reason why i
thought it may go in the DAL, but then again, it is a business rule,
that if one row is deleted in one table, other row in other tables
should be deleted.

Can someone please let me know, or pass an article for me to read.
I would say that in this case it's a combination of both BOL and DAL,
depending on how your DAL is constructed.

E.g. in my standard DAL I have an ExecuteInTransaction method which takes
multiple database writes and executes them in an explicit transaction,
returning a collection of the return values of each individual write plus an
overall bool of whether the transaction was committed or rolled back.

I would therefore construct a method or even an entire class in my BOL which
would assemble the various SQL actions and then pass them to the
ExecuteInTransaction method in my DAL.
Sep 20 '06 #2

Mark Rae wrote:
"Nemisis" <da*********@hotmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
I was wondering about where this code should go.

Basically i have several tables in my database, when i add a row to a
particular table, i will need to also add other entries in other
tables.

I would consider this to be code that should be in the BOL? Am i right
in thinking that?

The same if i was deleting records in the database, if a record is
deleted from one table, i need to also delete other entries in other
tables, BOL or DAL?

My database is setup with relationships so SQL will report errors on
foreign keys that cannot be deleted, so this is the one reason why i
thought it may go in the DAL, but then again, it is a business rule,
that if one row is deleted in one table, other row in other tables
should be deleted.

Can someone please let me know, or pass an article for me to read.

I would say that in this case it's a combination of both BOL and DAL,
depending on how your DAL is constructed.

E.g. in my standard DAL I have an ExecuteInTransaction method which takes
multiple database writes and executes them in an explicit transaction,
returning a collection of the return values of each individual write plus an
overall bool of whether the transaction was committed or rolled back.

I would therefore construct a method or even an entire class in my BOL which
would assemble the various SQL actions and then pass them to the
ExecuteInTransaction method in my DAL.
Mark,

Thanks for this, i have got my DAL and BOL that both accept a
IDBTransaction property, so i think i can handle it just as you said.

Cheers

Sep 20 '06 #3

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

Similar topics

2
by: Sean | last post by:
I have two sites that i use for personal stuff (family, friends, photos). They are PHP sites butim not a programmer. They were setup by a friend who no longer helps with them. There are some...
2
by: grahamo | last post by:
Hi, I have something that I'd like to clarify here.... there are two issues. I have simple dummy class called base which (everything is inlined just for readability) defines these methods... ...
11
by: 1111111111 | last post by:
Here is what I have so far... User is to enter 2 integers. One digit at a time. After that I have to print out what the user entered, and then add the two together. Example: Enter First Integer...
6
by: MLH | last post by:
If I cut it from the rest of the SQL, the query runs fine. But when I leave the following WHERE clause in there, Access tells me there's a missing Operator? WHERE (((tblVehicleJobs.SerialNum)...
9
by: javuchi | last post by:
I've been searching thru the library documentation, and this is the best code I can produce for this alogorithm: I'd like to return a dictionary which is a copy of 'another' dictionary whoes...
0
by: Jean-Marc Blaise | last post by:
Hi, The following page http://www-1.ibm.com/support/docview.wss?uid=swg1IY63894 states at top of page that FP8a fixes the problem, and at the bottom "First fixed in v8.2 fp9". Could you...
2
by: shapper | last post by:
Hello, I created a div with margin and padding and a fixed width. It seems the behavior is different in Firefox and IE. I am not sure but it seems: True width = width + paddingORmargin OR...
7
ilikesuresh
by: ilikesuresh | last post by:
Hi i have written this program to find the file information using stat structure. When i try to display the mode it shows blank(nothing) where is the problem lies here.. clarify me... ...
6
ilikesuresh
by: ilikesuresh | last post by:
Hi i write a program in Pro *C to increase the salary of employees based on some constraints. Its works fine and if i execute the program in the first time the salaries would be increased depending...
0
isladogs
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.