Hello Brad
Still I am curious how you think no dev database is reasonably expected to
ever change. If it's dev, isn't it in development? Change is unacceptable?
(How's that for the new software dev motto for 2004!) I would like to work
on these projects which are designed perfectly the first time and
requirements do not change two weeks later.
Perhaps where the development database and the code project live in an
isolated environment they can dictate to the external world what will be
delivered, then the development database's structure can be fluid according
to the whims of the developers. My experience's have shown that projects
have a much better chance of successfully meeting their objectives when
changes to specifications are minimized once the coding begins. If changes
become neccesary later on in the project, they become very expensive in
terms of productivity. That's the reality. Yes, requirements do change.
And those changes can get out of hand and destroy a project if you do not
have a procedure to qualify those requirements changes. I love change
control committees that are populated by bean counters who understand the
ramifications of downstream changes. They can get real stone-like when sales
dweebs or upper management has just go to have this thing-a-ma-jig added to
the project.
Database's reflect the business needs of their owners. Even when designing
a database from scratch in an all new business reality a well thought out
set of requirements, use cases, and a good understanding of the business
processes that the database is going to have to service should provide a
solid DB Model that requires little in the way of Entity modifications.
Maybe I belong in the ranks of the Anal Retentive DBA/Project Manager Union
but I believe in very strict change control by the time a project has
entered into the coding phase. (Soap box breaks...Ibrahim falls of of
it...calms down...looks human again...regains focus..moves on)
Now, to the original discussion; as Bill Ryan mentioned, one of the best
tools to use to maintain the retrieval of field data in a rowset is the
Enumerator. The use of the Enumerator is immune to field name changes and
(gulp)changing of ordinal positions. Here's an example of why:
"SELECT Firstname, Last Name, DOB, SSN, Age FROM Persons WHERE..."
Public Enum PersonData
FirstName = 0
LastName = 1
DOB = 2
Age = 3
End Enum
txtLastName.Text = MyTable.Items(PersonData.LastName)
simple, fast
Query changes to:
"SELECT FirstName, MiddleName, Last Name as FamilyName, DOB, SSN, Age FROM
Persons WHERE..."
uh oh...change in ordinal position and change in Field name. The only
change you have to make is in the Enumerator. The rest of your code does
not care about the order or naming conventions of your Rowset, it only needs
to have the right lookup index provided by the enumerator. IMHO Enums
provide one of the best protections from downstream changes to data
structures.
Public Enum PersonData
FirstName = 0
MiddleName=1
LastName = 2
DOB = 2
Age = 3
End Enum
--
Ibrahim Malluf
http://www.malluf.com
==============================================
MCS Data Services Code Generator
http://64.78.34.175/mcsnet/DSCG/Announcement.aspx
==============================================
Pocket PC Return On Investment Calculator
Free Download
http://64.78.34.175/mcsnet/kwickKalk1.aspx