Subject Re: [firebird-support] Re: joining 2 tables with 2 different foreign keys
Author Kjell Rilbe
dinol.softedge wrote:

> Thanks guys for all your help. I have decided to separate employee
> and assistant into 2 tables. I think it will alliviate headaches down
> the road. That post about different roles seems like a really good
> practice as well though and I will try that in the future. Thanks

The idea with roles is that you should make yourself aware that and
assistant *is* not an assistant, but rather a *person* with the *role*
of an assistant. If you model assistants and employees as separate
"objects" (separate tables with separate PK:s), then what happens when a
person suddenly turns out to be both an employee and an assistant?

Will you put that person in both tables? Wouldn't that make things
rather messy?

Better then to model all people as persons, and then link them to all
roles they play in your problem domain. That way, you won't have any
problems if a person unexpectedly plays mutiple roles.

Kjell Rilbe
E-post: kjell@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64