[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now


Exception Integration Advice....

Posted on 2003-11-15
Medium Priority
Last Modified: 2010-04-16

I am developing an application that requires the development of 30 user defined application exceptions.

Would it be prudent to design a dedicated dll that consists of all the custom exceptions and add it as a reference to the assemblies that require the exceptions or would it be advantageous to include only those exceptions that are required in each assembly.

kind regards Imran Farooq
Question by:imran89
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 10

Expert Comment

ID: 9754022
I would suggest a comprimise between the two... I would just have a .cs file which contains ALL the exception definitions, and include it in all projects that require it.

Author Comment

ID: 9754106
Just to understand your advice further...if I have 3 projects, one exe and two dlls they would each contain an identical .cs file consisting of all the custom defined exceptions.

Is this what you mean?

My concern is the duplication of the identical .cs file. Could there be a way to define the .cs file that all projects access without duplication?

kind regards Imran
LVL 10

Expert Comment

ID: 9754131
Yes, sorry, in this case, I would do as your first suggest.. create a dll which contains all the exception definitions, and add the dll as a refernce to all required projects.

Author Comment

ID: 9754190
by creating a dll with all the exceptions...would this effect the way the exception will be thrown?

kind regards Imran
LVL 10

Accepted Solution

ptmcomp earned 150 total points
ID: 9754206
I think the exception should be defined in the assemblies which are throwing them.
- If you desing properly you only get exceptions of the assemblies you directly include.
- If an assembly needs an exception definition more or less it's in the responsibility of the assembly

You may have an assembly with basic definition and an abstract base exception which is included in all assemblies.

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question