473,804 Members | 4,128 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1875
"Nemisis" <da*********@ho tmail.comwrote in message
news:11******** **************@ d34g2000cwd.goo glegroups.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 ExecuteInTransa ction 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
ExecuteInTransa ction method in my DAL.
Sep 20 '06 #2

Mark Rae wrote:
"Nemisis" <da*********@ho tmail.comwrote in message
news:11******** **************@ d34g2000cwd.goo glegroups.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 ExecuteInTransa ction 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
ExecuteInTransa ction 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
1851
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 things with the Gallery upload and topics that just don't work anymore. I suspect it would be trivial for someone who knows PHP to fix. I am willing to pay $100 a year for someone to keep the sites up and running...minimal time is needed. ...
2
1339
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... friend base operator+ (const base& lhs, const base& rhs) { base tmp;
11
1475
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 (one digit at a time) //-1 ends it 1 2 3 -1 Enter Second Intger (one digit at a time) //-1 ends it
6
1334
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) Like !! & '*') ; Any idea what missing operator Access is talking about?
9
1351
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 values are bigger than 'x' and has the keys 'keys': def my_search (another, keys, x): temp = another.fromkeys(keys) return dict( for k in temp.keys() for v in temp.values() if v>=x])
0
1059
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 clarify please ? Thanks a lot,
2
1904
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 True width = width
7
1979
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... #include<stdio.h>
6
1259
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 on the constraints.But if i execute immediately the second time, the updated values have been treated as a old value and again the salaries are incremented.Is there any specific way to ensure this if the update happens continuously on the second...
0
9706
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...
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10320
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
10077
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
9150
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
7620
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
6853
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
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4299
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

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.