Business Errors - Building Business Objects - Lecture Notes | ITEC 4770, Study notes of Information Technology

Material Type: Notes; Class: CLIENT/SERVER SYSTEMS; Subject: Information Technology; University: Armstrong Atlantic State University; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 08/04/2009

koofers-user-es7-1
koofers-user-es7-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Building Business Objects
Business errors:
constraint errors
business rules: Example: max salary raise is 7%, email addresses are correct
.NET exception classes: Debug > Exceptions
Creating error classes for the Northwind application: MaximumLengthException (pg 164) and
ZeroLengthException (pg 165) – zero length strings should not be stored in the database. These
exceptions are used to report errors for region description and for other fields stored into the database.
Errors are reported from the business tier to the user tier through structErrors (pg 165) and through a
collection of structErrors (pg 165) called BusinessErrors.
Adding business rules to data centric (DC) objects
Add a collection of errors to RegionDC (pg 166) and add to this collection if the user tries to set a zero
length or a too big region description (pg 167)
Self documenting object: add a list of errors that can occur in RegionDC: GetBusinessRules (pg 168)
Change RegionDC.Save to return the list of errors and to access the DB only if there were no errors
when setting the object properties (pg 170)
Adding business rules to the user centric (UC) objects
BrokenRules class is used to keep track of several violations so that they are all reported to the user.
Simple constraints errors are reported (pg 172)
In the Region class (UC object) we include a BrokenRules object that keeps track of all constraints
violations. When we create an empty region, constraints are violated because the region description is
empty (pg 174)
Add duplicate checks for constrains errors in the UC object (Region), and the set property for region
description (pg 176)
Displaying the Business Rules to the user (from the DC object)
Create a frmBusinessRules object that displays a list of field-rule pairs (pg 186) and add a btnRules
button to frmEditBase (pg 184) that displays the list (pg 185, pg 183)
Responding to object changes in the UI interface
Add an ErrorProvider object to the frmEditBase (pg 187) and respond to the user changing the
regionDescription by displaying an error if the string is invalid (190)
Handle Edit cancellations in frmEditBase (pg 192)

Partial preview of the text

Download Business Errors - Building Business Objects - Lecture Notes | ITEC 4770 and more Study notes Information Technology in PDF only on Docsity!

Building Business Objects

Business errors:  constraint errors  business rules: Example: max salary raise is 7%, email addresses are correct .NET exception classes: Debug > Exceptions Creating error classes for the Northwind application: MaximumLengthException (pg 164) and ZeroLengthException (pg 165) – zero length strings should not be stored in the database. These exceptions are used to report errors for region description and for other fields stored into the database. Errors are reported from the business tier to the user tier through structErrors (pg 165) and through a collection of structErrors (pg 165) called BusinessErrors.

Adding business rules to data centric (DC) objects

Add a collection of errors to RegionDC (pg 166) and add to this collection if the user tries to set a zero length or a too big region description (pg 167) Self documenting object: add a list of errors that can occur in RegionDC : GetBusinessRules (pg 168) Change RegionDC.Save to return the list of errors and to access the DB only if there were no errors when setting the object properties (pg 170)

Adding business rules to the user centric (UC) objects

BrokenRules class is used to keep track of several violations so that they are all reported to the user. Simple constraints errors are reported (pg 172) In the Region class (UC object) we include a BrokenRules object that keeps track of all constraints violations. When we create an empty region, constraints are violated because the region description is empty (pg 174) Add duplicate checks for constrains errors in the UC object (Region), and the set property for region description (pg 176)

Displaying the Business Rules to the user (from the DC object)

Create a frmBusinessRules object that displays a list of field-rule pairs (pg 186) and add a btnRules button to frmEditBase (pg 184) that displays the list (pg 185, pg 183)

Responding to object changes in the UI interface

Add an ErrorProvider object to the frmEditBase (pg 187) and respond to the user changing the regionDescription by displaying an error if the string is invalid (190) Handle Edit cancellations in frmEditBase (pg 192)