From: Moderated discussion of advanced .NET topics. Sent: Monday, February 16, 2004 12:43 PM > > > Only adding new tables, and making FK columns pointing > > to those tables NOT NULL, will cause a failure in > > un-modified code. Even if such columns are NOT NULL, > > if they have a default value -- e.g. 0 -- that matches > > a "default record" in the new table (e.g. one with > > "No such animal" in its description field), that won't > > break existing code. > > Wow, I can tell you've done medical development, where data is forever... > nice to see a kindred spirit. This is the "Null-object" pattern, and it's > saved my bacon in code and database more times than I can count. The > coolest thing is that because it's a "typed" null object, each one can > expose the appropriate behavior. In databases, you can allow "unknown > animal" match to lab result ranges for male's 30-36 or whatever makes > sense
I don't have a real problem with views/sprocs that provide SELECT * like some seem to have. Furthermore, I can think of many scenarios that will cause views and/or sprocs to break based on some approach that makes a developer/DBA formally stipulate the SELECTed fields. Ex: splitting columns, splitting tables (as J. Merill says), the need to rename a column, etc. There are many (relatively) common scenarios that will break a formally commalisted SELECT... more than you indicate. And, I work in a "medical development" environment! :) (However, as J. Merill states, INSERTs should always stipulate the commalist of columns. Operation that alter the state of the database should be forcibly precise.) The typical argument is that a SELECT * will cause retrieval of unnecessary data at times. If you normalize your database effectively, without going overboard, you won't often encounter this situation since there are more often than not very few fields per record... Maybe I'm missing something? _________________________________ Paul Tiseo, Systems Programmer Research Computing Facility Mayo Clinic Jacksonville, Griffin 371 [EMAIL PROTECTED] =================================== This list is hosted by DevelopMentorŪ http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 26 Jan 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com