473,480 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error Handling in Business Object Layer

Does anyone have suggestions on how to best handle errors in business
objects that are part of a business layer? For example:

Public Class Person
Private _name as string
Public Property Name as string
Get
Return _name
End Get
Set(Value as string)
If Value.toString.length > 50 then
'How do I send a friendly error message back to the
presentation layer saying the value isn't correct? I know I can
validate it on the form, but I'd like to also validate in the business
objects.
Else
_name = Value
End If
End Set
End Property

End Class
Thanks in advance for any help!!!
Big Dave

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
4 2051
In my business objects, I have a error collection class. It has a method to
pretty print the collection in html format.

I can then perform my business operation and catch all of the exceptions
without rethrowing them. Then, if my error collection has a size > 1 I know
there was an error and I print them to the page.

Or, just always put a try catch around business transactions and never put
them in your business/data layer.

There are always arguments either way..... to ignore errors in the
business/data layer and just continue processing or.... warn/throw an error
to the calling procedure when you encounter something bad!
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Big Dave" wrote:
Does anyone have suggestions on how to best handle errors in business
objects that are part of a business layer? For example:

Public Class Person
Private _name as string
Public Property Name as string
Get
Return _name
End Get
Set(Value as string)
If Value.toString.length > 50 then
'How do I send a friendly error message back to the
presentation layer saying the value isn't correct? I know I can
validate it on the form, but I'd like to also validate in the business
objects.
Else
_name = Value
End If
End Set
End Property

End Class
Thanks in advance for any help!!!
Big Dave

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #2
What do you do if Uncle Ernie drops his chopsticks?

--

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Michael Baltic" <Mi***********@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
In my business objects, I have a error collection class. It has a method
to
pretty print the collection in html format.

I can then perform my business operation and catch all of the exceptions
without rethrowing them. Then, if my error collection has a size > 1 I
know
there was an error and I print them to the page.

Or, just always put a try catch around business transactions and never put
them in your business/data layer.

There are always arguments either way..... to ignore errors in the
business/data layer and just continue processing or.... warn/throw an
error
to the calling procedure when you encounter something bad!
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Big Dave" wrote:
Does anyone have suggestions on how to best handle errors in business
objects that are part of a business layer? For example:

Public Class Person
Private _name as string
Public Property Name as string
Get
Return _name
End Get
Set(Value as string)
If Value.toString.length > 50 then
'How do I send a friendly error message back to the
presentation layer saying the value isn't correct? I know I can
validate it on the form, but I'd like to also validate in the business
objects.
Else
_name = Value
End If
End Set
End Property

End Class
Thanks in advance for any help!!!
Big Dave

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #3
LOL! I don't even know what movie/show that referenced, but I must have
laughed for like ten minutes!!!!
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Kevin Spencer" wrote:
What do you do if Uncle Ernie drops his chopsticks?

--

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Michael Baltic" <Mi***********@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
In my business objects, I have a error collection class. It has a method
to
pretty print the collection in html format.

I can then perform my business operation and catch all of the exceptions
without rethrowing them. Then, if my error collection has a size > 1 I
know
there was an error and I print them to the page.

Or, just always put a try catch around business transactions and never put
them in your business/data layer.

There are always arguments either way..... to ignore errors in the
business/data layer and just continue processing or.... warn/throw an
error
to the calling procedure when you encounter something bad!
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Big Dave" wrote:
Does anyone have suggestions on how to best handle errors in business
objects that are part of a business layer? For example:

Public Class Person
Private _name as string
Public Property Name as string
Get
Return _name
End Get
Set(Value as string)
If Value.toString.length > 50 then
'How do I send a friendly error message back to the
presentation layer saying the value isn't correct? I know I can
validate it on the form, but I'd like to also validate in the business
objects.
Else
_name = Value
End If
End Set
End Property

End Class
Thanks in advance for any help!!!
Big Dave

*** Sent via Developersdex http://www.developersdex.com ***


Nov 19 '05 #4
Thanks Michael,

Actuallly, it's a fragment that Uncle Chutney culled from a local radio
commercial. Taken out of context, it can mean almost anything, and strikes
me as quite ambiguously funny as well.

--
;-),

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Michael Baltic" <Mi***********@discussions.microsoft.com> wrote in message
news:7F**********************************@microsof t.com...
LOL! I don't even know what movie/show that referenced, but I must have
laughed for like ten minutes!!!!
--
Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com

Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group
"Kevin Spencer" wrote:
What do you do if Uncle Ernie drops his chopsticks?

--

Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven

"Michael Baltic" <Mi***********@discussions.microsoft.com> wrote in
message
news:D0**********************************@microsof t.com...
> In my business objects, I have a error collection class. It has a
> method
> to
> pretty print the collection in html format.
>
> I can then perform my business operation and catch all of the
> exceptions
> without rethrowing them. Then, if my error collection has a size > 1 I
> know
> there was an error and I print them to the page.
>
> Or, just always put a try catch around business transactions and never
> put
> them in your business/data layer.
>
> There are always arguments either way..... to ignore errors in the
> business/data layer and just continue processing or.... warn/throw an
> error
> to the calling procedure when you encounter something bad!
> --
> Direct Email: Michael.Baltic@RemoveCharactersUpTo#NCMC.Com
>
> Staff Consultant II
> Enterprise Web Services
> Cardinal Solutions Group
>
>
> "Big Dave" wrote:
>
>> Does anyone have suggestions on how to best handle errors in business
>> objects that are part of a business layer? For example:
>>
>> Public Class Person
>> Private _name as string
>> Public Property Name as string
>> Get
>> Return _name
>> End Get
>> Set(Value as string)
>> If Value.toString.length > 50 then
>>
>>
>> 'How do I send a friendly error message back to the
>> presentation layer saying the value isn't correct? I know I can
>> validate it on the form, but I'd like to also validate in the business
>> objects.
>>
>>
>> Else
>> _name = Value
>> End If
>> End Set
>> End Property
>>
>> End Class
>>
>>
>> Thanks in advance for any help!!!
>> Big Dave
>>
>> *** Sent via Developersdex http://www.developersdex.com ***
>>


Nov 19 '05 #5

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

Similar topics

3
4764
by: Steve - DND | last post by:
I was wondering if anyone can point me to some articles or practices they use for dealing with errors in their applications; particularly in an n-tier design. I am trying to find one way to...
4
2511
by: aaj | last post by:
Hi all I have an automated application, that runs in the middle of the night. If certain 'non system' errors occur (things like malformed files, missing files etc..), I send an automatic Email...
1
2298
by: Oscar Thornell | last post by:
Hi, I have an ASP.NET page that generates an Exception... The Exception is not caught in the executing method...so it propagates to..the Page_Error event handling method.. In that method the...
1
483
by: michaeltorus | last post by:
Hi I'm currently designing a new web application in .Net. I've pretty covered everything, apart from error handling. There seems to be a few different way to do this, but something I've read...
4
7597
by: James Radke | last post by:
Hello, I am looking for guidance on best practices to incorporate effective and complete error handling in an application written in VB.NET. If I have the following function in a class module...
1
1866
by: Nemisis | last post by:
hi guys, Currently converting an old classic asp system to a OOP asp.net application. We are building the new application using a 3 tier arcitecture and i was wondering about the following. ...
0
1022
by: acnx | last post by:
I have an ntier application. I am trying to determine what is the best practice for handing errors in a datagrid. My datagrids are able to add, update and delete data. I am using a...
8
4113
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well....
8
1740
by: Charles Law | last post by:
This is a sort of pattern question, but relating to how components are coupled in a three-tier system. I have a presentation layer, business layer and data access layer, the first is the EXE,...
0
7037
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
7034
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
7076
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...
1
6732
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6886
tracyyun
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...
0
5324
agi2029
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,...
0
1294
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 ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.