<FB>        Now, the manager thinks he needs to know when each employee
started at which department. To model this correctly, you have to
objectify the department-employee relationship into a relation, and add
a non-pk, mandatory attribute 'StartDate'.

        Now, go back to the codesnippet I just posted. It definitely
will not work, you need to add StartDate as well, as it is mandatory.
You also can't add the employee directly to Employees in the department
object, as it is related via a 3rd entity, so to reach the department
from an enmployee, the developer has to do something like:
</FB>

If someone with any decency did this to a database, they first would have to
establish what mandatory StartDate to assign to all existing rows in the
database, then and ONLY then could they define the column as NOT NULL.  The
EXACT same logic could be codified in support of the OLD interface.  They
might punt and make it some magic number (like 1/1/0000), or they might make
it the current date, or even some very difficult lookup of other data in the
database, but they would HAVE to do something to supply the correct value to
fill in that new mandatory field.  So all existing code would automatically
be supported.  New code could set the column to a reasonably correct value
at it's discretion.

Now suppose that this code hasn't been released, so there are no existing
rows in the database.  Then the project manager decides if supporting the
old interface with the necessary cost of establishing the defaulting rules
is more or less costly than revisiting the _also unshipped_ client code.
Whatever discussion is best for the company can be handled with ease.

The problem with most of these discussions is that it completely ignore the
revisioning of interfaces, because that is a hard problem to solve
generically.

Marc

===================================
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

Reply via email to