Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2005, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Errors in a business layer

Hello,

I'm developing an n-tier system, with a presentation layer (ASP.NET site), business layer (class library), data layer (class library), and security layer (class library).

I was curious if anybody had any ideas regarding errors in the business layer. I have try catch blocks for catching errors in the business layer, but am not sure quite how to handle getting the error back to the user interface. I don't want to get into a habit of throwing errors due to performance, so I was curious if anybody had any implementations that they would like to share.

Thanks,

Brian
__________________
Brian
 
Old February 11th, 2005, 02:27 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Brian,
I think you can make an event in your inner layers and use them in outer layers, for example you can have an public event like ErrorNotify,
Code:
try
{
}
catch(Exception oException)
{
  //do some other stuff
  //execute the event(call its method)
  //and send the exception inside your own EventArgs
}
then in your ASP.NET layer(the next layer) you can use this event like
Code:
BLobject.ErrorNotify+=new ErrorNotifyHandller(ErrorOccured)
//then in your ErrorOccured method you can 
//redirect users to ErrorPage.aspx
also you can make your own EventArgs and ErrorNotifyHandller delegate in another assembly then in your ASP.NET page you would receive your ownEvenetArgs as a parameter of your ErrorNotifyHandller delegate.

_____________
Mehdi.
software student.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Handle error from database layer to applican layer khatu_jec ASP.NET 2.0 Basics 1 November 9th, 2008 03:51 PM
Transparent Business Layer pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 5 February 17th, 2008 02:19 AM
Do we need Business Logic Layer.vb files? cJeffreywang ASP.NET 2.0 Professional 12 January 12th, 2008 06:28 AM
Handle Transactions from Business Logic Layer sonishpaul ASP.NET 2.0 Professional 1 December 3rd, 2007 05:52 AM
Question about Business Layer hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 March 21st, 2005 06:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.