Chapter 22 -- What About the Business Rules?

[Previous] [Next]

Chapter 22

As early as in Chapter 3, "On Rules and Their Locations," we described a set of eight rules that should govern our simple example application, or more correctly, partial application. In Chapter 4, "Implementing the Rules," we studied each of these business rules, trying to decide how to implement them. Since then we've hardly discussed these business rules at all, even though we have designed and even implemented a portion of our sample application. At the end of Chapter 4, we published Table 4-1, detailing how we finally decided to implement each of the rules. For your convenience, we copied that table as Table 22-1.

The purpose of this chapter isn't to repeat anything already said in Chapter 4. Instead, it's to investigate the implementation of the eight rules to see how it should influence our solution. We'll carry out this investigation under five different headings, each representing one type of rule implementation:

  • Foreign key constraints
  • Check constraints
  • Unique constraints
  • Identity columns
  • Business object constraints

Table 22-1. Eight rules and their implementation. (Copy of Table 4-1.)

Rule # Rule Implementation
1 Bred in country. Database: foreign key
2 One and only one trainer. Database: foreign key
3 Value of sex must be valid. Database: check constraint
4 Only one kind of sex change allowed. Business object: Visual Basic
5 Between 1 and 15 years old. Database: check constraint
6 Don t delete a horse that has run at least one race. Business object: Visual Basic
7 Unique combination of name and country where bred. Database: unique constraint
8 Unique ID when inserted. Database: identity column (for now)



Designing for scalability with Microsoft Windows DNA
Designing for Scalability with Microsoft Windows DNA (DV-MPS Designing)
ISBN: 0735609683
EAN: 2147483647
Year: 2000
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net