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 1 1402
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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: http://www.rockley.com/workshops.htm
The Rockley Group Content Management Workshop Series is designed to
|
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 Exception management.
I have read two MSDN documents that appear to be in contradiction, and I
would like to know if someone can explain to me which of the two is the
|
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 "bookmarked", but all of them don't go too
far on memory management as I would like. One of my main issues
is whether function "main" and its local variables are allocated
on the stack area as other functions.
Does anybody recommend a good book or...
|
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 error:
------------------------------------
System.Security.SecurityException: The event source
ExceptionManagerInternalException does not exist and cannot be created with
|
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 user tasks should always be
included in a try/catch block that actually handles any exceptions that
occur (log the exception, display a message box, etc.).
2. Low-level operations that are used to carry out the high level tasks
| |
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 to handle exceptions. Say
forexample I have a requirement where certain value has to be between
30-72 only and Iam doing this validation in the the BL. if the value is
not between 30-72 then Iam throwing an exception back to the UI layer.
Is this...
|
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 recommended to use the addHandler method in each form for
ApplicationThreadExceptions and then just handle everything else using
try/catch blocks and rethrow if the exception can't be handled?
Is it recommended to let all exceptions bubble up...
|
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 entertaining :-)
<%= Clinton Gallagher
|
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 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...
|
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |