The Database

[Previous] [Next]

The diagram in Figure 4-1 shows the parts of the database we'll use in this example. The diagram might not represent the final version, but it reflects pretty well what we know at this point.

click to view at full size.

Figure 4-1. A part of the database that our sample application is concerned with.

The four tables in Figure 4-1 have the following purposes:

  • The Horses table is the main table for this sample application. It receives insertions, updates, and possibly deletions.
  • The Countries table helps maintain rule 1 (introduced in Chapter 3, "On Rules and Their Locations")—horses are bred in one country only.
  • The Trainers table helps maintain rule 2—each horse has one and only one trainer.
  • The RaceEntrants table must be checked for references to any horse that's to be deleted. This procedure helps you maintain rule 5, in which you deactivate rather than delete horses that have participated in races.

The term neighborhood is sometimes used to refer to a set of tables such as the one in Figure 4-1. You select the main table (or main tables) needed by a certain business process or use case. Then you look at each one of the neighbors of each main table to see whether you should take that neighbor into consideration when designing a procedure to support that use case. Sometimes you even need to use the neighbors of the neighbors to get the complete picture. It's always a good idea to set up a neighborhood for each use case in an application.

Let's take a look at the eight rules that govern the sample application and decide how to implement each one of them.



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