| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Is this bad design ?
... your initial question was: is this bad design?
It think it is. It is redundant and error prone. If you cannot change
the database schema, you must live with your design.
But, if database access is encapsulated in one class/package/module in
your application, it should be possible to change the database schema
without too much side effects? Instead of setting still_valid to
true/false you must insert(if non-existing)/delete a row in ValidMother.
This may be realized as a stored procedure. I would say that adding
constraints to a database schema often has impact on the application
level if normalization/redundancy is an issue (thats why db access
should be encapsulated).
Regards,
Fabian
ben brugman wrote:
> "Fabian Buettner" <green_at_tzi.de> wrote in message
> news:404DC817.2090804_at_tzi.de...
>
>>If only valid mothers can have children, you could partition your Mother >>table as follows: >> >>Mother( mother_id primary key, etc_fields ) >>-- all mothers >> >>ValidMother( mother_id primary key + foreign key ref Mother(mother_id)) >>-- "valid mother" ids >> >>Child( mother_id foreign key ref. ValidMother(mother_id), more_fields) >> >>This way you can ensure that only valid mothers are referenced by >>children. Also (if referential integrity is available), a mother can not >>become invalid (i.e., delete entry from ValidMother) when there are >>still children referencing it.
>
Received on Tue Mar 09 2004 - 10:36:13 CST
![]() |
![]() |