Editorials

An error in the Rule?

SSWUGtv
With Stephen Wynkooop
Altova’s Peter O’Kelly talks about the new releases for all your developing needs.
Watch the Show

An error in the Rule?
In response to yesterday’s editorial Ralph writes:

Your business rules for booking a flight may sound great to you but there is actually a flaw in them as stated. I have often done "day trips", i.e. fly out at 06:30 from, say, OKC to DFW with a return flight at 18:00. (Admittedly, it was easier to do this before 9/11 but it is still possible . . . although a killer of a work day. 😉

I have always used a "Modified Mayor Daly Rule" for business rules and data constraints. Instead of the "Vote early, vote often" rule, I believe in the "Check early, check often" rule. Check as soon as possible in the data flow but continue to check at later stages because the front-end validations may not be able to easily catch other conflicting constraints.

Ralph, you are correct that a flight rule would need to accommodate flite itinerary occurring on the same day. In fact, it is quite possible that using connecting flights, a flight may end only minutes, or hours after departure.
I think the table and check constraint demonstrated yesterday work with this in mind because the datatype used is a DATETIME data type. Therefore, the beginning of the flight in your example may be 09/03/2012 06:30 with an end flight time of 09/03/2012 18:00.

Regardless, I appreciate the fact that you also consider the need for validation in more than one place. ETL tools are a good reason to have solid database design and constraints. In many worlds, not all data enters or exits your database through your applications enforcing business rules.

Send your comments to btaylor@sswug.org.

Cheers,

Ben

$$SWYNK$$

Featured Article(s)
User Control Partial data binding of huge data to a GridView in an optimized way in .Net
Bind huge data to a Gridview without deteriorating the performance. Moreover it is all automated. A very light weight tool that minimizes network traffic, memory concerns and performance degradation.

Featured White Paper(s)
Migrate to SQL Server’s next release with ease and optimize the database workload at any time.
read more)

Featured Script
dba3_MedicalDB_SecurityRolesAndUserLoginsSetup_Article
Legislated mandates are driving more implementations of row level security schemes . The article describes a generic DBMS bas… (read more)