Re: OO versus RDB

From: H. S. Lahman <h.lahman_at_verizon.net>
Date: Wed, 28 Jun 2006 15:19:27 GMT
Message-ID: <36xog.1576$%67.367_at_trndny02>


Responding to Marshall...

>>>A schema change breaks a query or it doesn't.
>>>If it doesn't all is well.
>>>If it does you'll have to investigate the code
>>>dependent on the query.
>>
>>It breaks the query, but not the problem solution that needs the data.

>
>
> This sounds sensible, but isn't. Any schema-change breakage
> will affect both query and code. If a queried column is deleted,
> the query will need changing, but also the code has to reconsider
> what it will do in the absence of the column.

I'm afraid that is not true. Consider

[SalariedEmployee]
* employeeNo
+ salary
...

where 'salary' is semantically defined as base salary. Now suppose it becomes necessary to keep track of burdened salary. For whatever reasons the DBA decides to deliberately denormalize and use a separate attribute that depends on 'salary' and other attributes of [SalariedEmployee]. (With appropriate stored procedures to synchronize the value with changes to those attributes.) The DBA then proceeds to "clean up" the schema:

[SalariedEmployee]
* employeeNo
+ baseSalary
+ burdenedSalary
...

The semantics of 'baseSalary' is exactly the same as the original 'salary' so an application needing the base salary still uses exactly the same value. But it can't get it without rewriting the query to use the new field name. However, the application solution doesn't care about what the schema name is or even where it comes from. IOW, the application solution is completely unaffected by the schema change -- provided one encapsulates RDB access in a subsystem and changes the query there.

This sort of situation is actually rather common at the enterprise level. That's because different applications use the same data for different reasons. When requirements changes trigger changes to the schema, those requirements typically only affect some of the reasons the applications use the data. So only a fraction of the applications that use the data are affected by the change and have to be modified for the requirements changes. For the rest of the applications the requirements changes simply aren't relevant so the change to the schema should be transparent to those applications.



There is nothing wrong with me that could not be cured by a capful of Drano.

H. S. Lahman
hsl_at_pathfindermda.com
Pathfinder Solutions -- Put MDA to Work http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman Pathfinder is hiring:
http://www.pathfindermda.com/about_us/careers_pos3.php. (888)OOA-PATH Received on Wed Jun 28 2006 - 17:19:27 CEST

Original text of this message