If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Best practices question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-06, 01:22
JMKeynes JMKeynes is offline
Registered User
 
Join Date: Mar 2006
Posts: 1
Best practices question

I have been racking my brain for a way to handle this problem and am hoping for some advice on the best way to develop a workable data model in SQL Server 2000 that is still object-oriented and easy to query.

Assume an unknown number of heterogeneous objects that have an arbitrary number of relationships among any two or more object attributes (I have defined objects, their attributes and relationships, but do not have perfect foresight for our needs in the future). Examples:

1. A person can be an author, user, participant, employee, non-employee, etc (not mutually exclusive) and has: (a) address(es), email_address(es), institutions(es), etc.; (b) outputs, e.g., publications, presentations, etc. where each of the outputs has attributes that may be common or unique; (c) subordinate person(s); (d) access rights for themselves and their subordinates (at an object level); (e) demographic data; (f) can attend events (e.g., conferences, symposia, short_courses); and any other information that I may need to track (and will hopefully discover during the design process!)

2. Given the above description is probably poor, please permit me to give a more real world structure - a collection of vitae (for example, http://www.quintcareers.com/vita_sample_3.html)


A precursory literature review indicates that the consensus of the community is EAV approaches are frowned upon. Granted I am no where near an expert in this area, but I would tend to agree as it seems that ad-hoc querying in the domain of this model are time and resource intensive. Yet, by creating a table for each object I am not quite certain how to deal with querying attributes between the tables while preserving the object (and not having to create SQL blocks of equal complexity to the EAV approach).

As data warehousing would be the primary use for this data, easy access and manipulation is a must. Ultimately, my question is how do I maintain the benefits of EAV, yet maintain the ability for filtering the data without having to create an arbitrary number of self-joins?

Thanks in advance for any help.

As an aside, what have people found to be the best model for domestic and foreign addresses?
Reply With Quote
  #2 (permalink)  
Old 03-10-06, 16:05
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
What you are discussing could probably best be described as a series of many-to-many relationships.

A person to their roles
A person to other persons
A person to their outputs (i.e. a book can have multiple authors)

Howwever, while it is possible for an address to have multiple people associated with it, this is probably a case where a 1-N relationship would be used.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On