473,324 Members | 2,166 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,324 software developers and data experts.

Best practices for validating business rules

Hi,

I'd like to know if anyone knows of any resources detailing the best
practices of validating rules in the business tier and providing
helpful error messages to users in the UI tier. All the information I
have come across seems to revolve around using validation controls on
the webpages themselves, which is not always feasible.

Regards,

Chris

Jul 27 '07 #1
2 1959
There are a couple of things you can do. IN general, however, I find it
easiest to throw exceptions up to the UI for problems and then parse the
exception there. It is very specific and does not require passing back
values.

Of course, you can also use enums.

public MyEnum TestValidation()
{

if(failedOneValidation())
return MyEnum.FailedOneValidation;
if(failedTwoValidation())
return MyEnum.FailedTwoValidation;

}

But, this is harder if you embed it down levels, which often happens in
tiered approaches. Exceptions can bubble all the way to the UI and be
handled there.

To make sure these validations are logged, you can use the new policy
injection block (part of EntLib 3.1). Then you can turn on or off items by
config.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
<ha******@hotmail.comwrote in message
news:11*********************@l70g2000hse.googlegro ups.com...
Hi,

I'd like to know if anyone knows of any resources detailing the best
practices of validating rules in the business tier and providing
helpful error messages to users in the UI tier. All the information I
have come across seems to revolve around using validation controls on
the webpages themselves, which is not always feasible.

Regards,

Chris

Jul 27 '07 #2
a common approach popular in the java world is to use a rules engine
thats hosted by the business logic layer (JBoss, JxBRE, SRE, etc). this
layer can also pass info used to generate the page validators, so
validation logic is all in one place.

on sourceforge.net, along with the java source you can find some .net
ports. there are also commercial products.

-- bruce (sqlwork.com)

ha******@hotmail.com wrote:
Hi,

I'd like to know if anyone knows of any resources detailing the best
practices of validating rules in the business tier and providing
helpful error messages to users in the UI tier. All the information I
have come across seems to revolve around using validation controls on
the webpages themselves, which is not always feasible.

Regards,

Chris
Jul 28 '07 #3

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

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
18
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
6
by: Nate | last post by:
I am in a slight predicament trying to determine the most efficient and effective way to connect/disconnect from a database within a business object (c# dll). I'm also keeping in mind the concept...
4
by: Tarun Mistry | last post by:
Hi all, I have posted this in both the c# and asp.net groups as it applies to both (apologies if it breaks some group rules). I am making a web app in asp.net using c#. This is the first fully OO...
13
by: Alan Silver | last post by:
Hello, MSDN (amongst other places) is full of helpful advice on ways to do data access, but they all seem geared to wards enterprise applications. Maybe I'm in a minority, but I don't have those...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
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...
1
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.