Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to deal with error on update?
Message
 
 
To
15/03/2010 00:20:01
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01454304
Message ID:
01454935
Views:
27
Hi Bonnie,

Getting back to what you said about "evaluating rules", isn't it the role of DAL to come across a broken rule set in the database? For example, a UNIQUE value rule that is set in the database; how would my Business layer "know" if this rule is broken until the data is sent to DB via DAL? Or am I missing something again?

Thank you.

>Dmitry,
>
>>What I am trying to do is to deal with issues caused by user inadvertently leaving entry in the field that requires entry blank or entering a duplicate value. And in this case all I want is that the DAL (via call to SP) to return back to UI the error message from stored procedure (which I am thinking about changing into easily readable for a user). And then, without Un-Doing the entry let the user make the changes him/herself. That is, I don't want the DAL to Un-Do but only to return the "error" message to the UI.
>
>IMHO, that is really not the job of the DAL. The DAL should simply do the DataAccess (read/write to the database). Period. It should not be evaluating any kind of rules, which is, after all, what you've just explained. A broken rule. That should be caught, by your Business layer, before it ever gets back to the DAL.
>
>My 2 cents, take it for what it's worth. ;0)
>
>~~Bonnie
>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform