473,396 Members | 2,111 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,396 software developers and data experts.

Exception Layer?

Hi everyone,

As i have said before i am new to the 3-tier architecture and so far, i
have wrote quite a bit for both my DAL and BLL. Now one thing i want
to sort out is exceptions.

Should i just create an exception class within each layer? That way
the BLL, will know about the DALExceptions, GUI with know about BLL
etc. Or is it better to create a full exception library and include
that within the DAL (this doesnt sound right, but thought i would ask).

Many people dont seem to agree, but i thought, for example, if i had a
company and i needed to check that data before saving it, this would be
code for the BLL? Say the companyName had to be entered, else i was
not going to allow for the company to be saved. Am i right?

I would think this because, if i were to create another DAL, for xml
instead of SQL, i do not want to re-write all the checks again in both
DALs.

Thanks

Sep 29 '06 #1
1 1988
Hello Nemisis,
NAs i have said before i am new to the 3-tier architecture and so far,
Ni have wrote quite a bit for both my DAL and BLL. Now one thing i
Nwant to sort out is exceptions.
N>
NShould i just create an exception class within each layer? That way
Nthe BLL, will know about the DALExceptions, GUI with know about BLL
Netc. Or is it better to create a full exception library and include
Nthat within the DAL (this doesnt sound right, but thought i would
Nask).

Even if u create full exception library (there are some of them already
created, for example see on Microsoft Exception Blocks) you need to know
how to differ you exceptions to proper distinguish them. There is no significant
difference what u choose, it's up to you, but it must be flexible for future
extensibility.

You can use MS Exception Block for exception management and prolong exceptions
to the required level.

NMany people dont seem to agree, but i thought, for example, if i had
Na company and i needed to check that data before saving it, this
Nwould be code for the BLL? Say the companyName had to be entered,
Nelse i was not going to allow for the company to be saved. Am i
Nright?

You need to perform checks both on client and business layers, because it's
too waste and insecure to rely only on one layer's checks.

NI would think this because, if i were to create another DAL, for xml
Ninstead of SQL, i do not want to re-write all the checks again in
Nboth DALs.

DAL shouldn't be responsible for you business domain, it only manage your
data -whatever u supply.

---
WBR,
Michael Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Sep 29 '06 #2

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

Similar topics

1
by: Abelardo Vacca | last post by:
Hello, I am currently in the process of switching our application to a N-Tier model with .NET. One of the aspects we want ot get right from the start not to worry about it after is the...
2
by: tom | last post by:
Hi, I am developing a WinForm application and I am looking for a guide on where to place Exception Handling. My application is designed into three tiers UI, Business Objects, and Data Access...
7
by: Andy | last post by:
Hi all, This is more of a design question. I'm building an n-tier application, and the question revolves around the buisness layer telling the application that a value is not appropriate for...
28
by: jakk | last post by:
Hello All, I have a question about how to handle exceptions. Iam working on an ASP.NET application which has a presentation layer, Business Layer and DataAccess Layer. Iam confused about where...
2
by: Rajeev Soni | last post by:
Hi, Considering the scenario for handling exceptions in Web Application where we have Presentation layer, Business layer and Data Access layer; if there any exception is occurred in DAL, what is...
1
by: leodippolito | last post by:
Hello, I have these entities in my ASP.NET application: - data access layer (DATA) - custom exception class (EXCEPTION) - cache management class (CACHE) They're all built into different...
1
by: problemKing | last post by:
Hi all, I had created a Remoting Custom Exception that inherits from System.Exception. Now, i meet the same problem that has been posted by previous thread...
1
by: Jarsinio | last post by:
I have some doubts about how managed exception in a VB.net aplication. In my aplicattion I have 3 clases: One clase is the UI ( Windows Forms). This class call a second clase who perform an...
1
by: | last post by:
I have an application that has a presentation later, business layer, and data layer. All three projects have their own exception policy, the "UI Policy", "BL Policy", "DL Policy", all of which...
1
by: Ami | last post by:
We have an application where in SOAP is used as a middle layer to communication between Java Front layer and DCE( Distributed Computing Env) backend layer. We are using Systinet Server for C++ to...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.