Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] database design idea... what do you think?
- Date: Tue, 15 Jan 2008 10:57:55 +0900
- From: "emiddleton@example.com" <emiddleton@example.com>
- Subject: Re: [tlug] database design idea... what do you think?
- References: <f91aa3d0801102138m5bee573t4bb1ba09eca30edd@mail.gmail.com>
- User-agent: Thunderbird 1.5.0.9 (X11/20070105)
Micheal Cooper wrote: > College database application, with administration users who frequently > request new things added to the database. > > What do you think of the following idea for a way to introduce ad-hoc > attributes for users: > > Make table "attributes" in a many-to-many relationship with table > students. Include from_date and to_date to indicate the dates the > student acquired and lost this attribute. Also include field operator > to record the user who entered the data and change_date to record the > actual timestamp of the data entry. Attributes about the student that > need to be tracked (like advanced placement, scholarship, probation, > etc.) are each a record in the table. I generally take the approach of working out the object model and then mapping it to the database using standard OR mapping patterns (i.e. ActiveRecord, Foreign Key Mapping, Association Table Mapping, Single Table Inheritance[1]). Creating the schema this way forces you to think about whether something is really an attribute of a student or a relationship between a student and some other object. It also helps avoid schema hacking. Edward 1. Patterns of Enterprise Application Architecture by Martin Fowler
- References:
- [tlug] database design idea... what do you think?
- From: Micheal Cooper
Home | Main Index | Thread Index
- Prev by Date: [tlug] Re: Tlug Digest, Vol 25, Issue 14
- Next by Date: [tlug] Re: Tlug Digest, Vol 25, Issue 14
- Previous by thread: Re: [tlug] database design idea... what do you think?
- Next by thread: Re: [tlug] database design idea... what do you think?
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links