Re: Tabe Relationship

From: Damjan S. Vujnović <damjan_at_NO_SPAM.galeb.etf.bg.ac.yu>
Date: Tue, 11 Mar 2003 18:54:30 +0100
Message-ID: <b4land$702$1_at_news.etf.bg.ac.yu>


Bernard Peek wrote:

>> What if USER can be both Administrator and Staff (or any other 
>> combination)?

>
> In that case the role is an attribute of a USER. You can implement that
> in tow different ways.
>
> You could add boolean fields in the USER table, that's simplest if you
> know for sure how many roles there will be. It's simple but adding a new
> role could be a pain.
>
> The other way is to create a separate ROLE entity and a link-entity
> between USER and ROLE. That makes it much easier to add a new role.
> Following on from what I said in another thread, take a close look at
> link-entities to see whether they have important attributes. For
> instance is it desirable to log changes to the roles for security purposes?

I agree, but... Although this "optimization" will speed-up data access, some extra activity has to be done in order to ensure data consistency (integrity, whatever). We have to be sure that touples in ROLE relationship match the presence of user_id as foreign key in Client, Administrator and Stuff tables. This is of course not a big overhead, but is worth mentioning. And finally, a very personnal remark. During my (not so big) production experience, I've always met all the timing requirements and *never* used such an approach.

-- 
Regards,
Damjan S. Vujnovic

University of Belgrade
School of Electrical Engineering
Department of Computer Engineering & Informatics
Belgrade, Serbia

http://galeb.etf.bg.ac.yu/~damjan/
Received on Tue Mar 11 2003 - 18:54:30 CET

Original text of this message