So do you model this in an OO fashion or is this all database design?  I am thinking specifically on the attribute ... is there different types of attributes (i.e. email, plain text, date, etc.)?  Is there any checking / validation of the attribute?  How are you storing the attribute in the database table ... are all attributes expected to fit in a varChar(50) field?
 
Thanks
-- Jeff


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Roland Collins
Sent: Thursday, June 29, 2006 3:31 PM
To: CFCDev@cfczone.org
Subject: RE: [CFCDev] Modeling a user and its profile

We use lookup tables.  A simplified version of our ERD is attached.

 

Basically, you normalize the attributes into a separate table and then use a one-to-many reference table to map users to their attributes.  For the attached ERD, you can pull a user’s attributes with this query:

 

SELECT u.user_id,

            a.attribute_id,

            a.nm,

            ua.value

FROM (users u INNER JOIN user_attributes ua

            ON u.user_id = ua.user_id) INNER JOIN attributes a

            ON ua.attribute_id = a.attribute_id

WHERE u.user_id = @user_id

 

HTH,

Roland

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Chastain
Sent: Thursday, June 29, 2006 3:54 PM
To: CFCDev@cfczone.org
Subject: [CFCDev] Modeling a user and its profile

 

I am working on a portal type application where a "user" will really only be made up of a username and a password.  That user will then have a profile which would contain other standard details like the user's name, address, email, etc.  The question I am faced with is that for different instances of this application, the application admin needs to be able to customize the contents of the user profile.  For example, via a web interface, admin A can set his user profile to contain the user's first name, middle initial, last name, and email address.  Admin B however would be able to set his user profile to also contain the user's home address, work address, and phone number.

 

So, I can see a user profile type object here, but how do you dynamically assign properties to that user profile without having any idea what those properties might be at design time?  Anybody modeled or seen anything like this before?

 

Thanks

-- Jeff

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org

Reply via email to