473,320 Members | 1,865 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,320 software developers and data experts.

Exception management architecture question


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 DLL's.

The EXCEPTION class depends on the CACHE class to get the cached
application error messages. The CACHE class depends on the DATA class
to retrieve data (that is, the error messages) from the database.

EXCEPTION -> CACHE -> DATA

The problem is: I need to throw a custom exception in the DATA layer
(for concurrecy DB errors). To do this I would have to add a reference
in the DATA layer of the EXCEPTION project. But I can't do that,
because Visual Studio gives me an error of cyclic reference. I would
have:

DATA -> EXCEPTION -> CACHE -> DATA

So, what could I do?

I thought of storing the error messages in an XML file, instead of in
tables in the database. Then I could have:

DATA -> EXCEPTION -> CACHE -> XML

But the best would be to keep the messages in the database. Is there
any possibility of keeping the messages in the database and still throw
a custom EXCEPTION in the DATA layer?

Well, I appreciate any help on this issue.

Leonardo D'Ippolito

Nov 19 '05 #1
1 1383
In general (there are always exceptions, no pun intended) you can't have
circular compile time references and that's a good thing. The direct way
to solve this is to merge the code that has dependences into a single assembly.
Personally, I'd think the Cache and Data should be together. If they throw
custom exceptions, then I'd also think that'd be in the same assembly. The
whole point of factoring types out into their own assembly is when you plan
to reuse those types elsewhere in other applications, typically.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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 DLL's.

The EXCEPTION class depends on the CACHE class to get the cached
application error messages. The CACHE class depends on the DATA class
to retrieve data (that is, the error messages) from the database.

EXCEPTION -> CACHE -> DATA

The problem is: I need to throw a custom exception in the DATA layer
(for concurrecy DB errors). To do this I would have to add a reference
in the DATA layer of the EXCEPTION project. But I can't do that,
because Visual Studio gives me an error of cyclic reference. I would
have:

DATA -> EXCEPTION -> CACHE -> DATA

So, what could I do?

I thought of storing the error messages in an XML file, instead of in
tables in the database. Then I could have:

DATA -> EXCEPTION -> CACHE -> XML

But the best would be to keep the messages in the database. Is there
any possibility of keeping the messages in the database and still
throw a custom EXCEPTION in the DATA layer?

Well, I appreciate any help on this issue.

Leonardo D'Ippolito


Nov 19 '05 #2

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

Similar topics

0
by: Scott Abel | last post by:
For immediate release: The Rockley Group Content Management Workshop Series Coming to Atlanta, Seattle, Vancouver, Chicago, Washington, DC, Toronto, and Research Triangle Park Learn more:...
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...
9
by: Rafael Charnovscki | last post by:
I can comprehend the basics of that subject (pointers, memory allocation, heap, stack etc), but I am interested to have references with more details. I have some C/C++ books and lots of URLs...
5
by: PCC | last post by:
I am using the Exception Managment Application Block on Windows Server 2003 Enterprise and .NET v1.1. If I use the block with an ASP.NET web wervice or in a web application I get the following...
44
by: craig | last post by:
I am wondering if there are some best practices for determining a strategy for using try/catch blocks within an application. My current thoughts are: 1. The code the initiates any high-level...
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...
1
by: Jon | last post by:
Can someone point me to a best practices for exception handling in .Net 2? We have a method that we like for ASP.Net apps on .Net 1.1, but are just moving to 2.0 with winforms apps. Is it still...
4
by: clintonG | last post by:
I was wondering if anybody has put together a FAQ documenting the hierarchy of various exceptions? Trying to learn and remember which to include and which order to process exceptions is not...
1
by: Nemisis | last post by:
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.