Subject | Re: [firebird-support] Re: DB design |
---|---|
Author | Jason Dodson |
Post date | 2005-07-27T17:30:01Z |
Naming your tables, aside from being descriptive of what they hold,
shouldn't matter, except for preference. I simply asked, because this is
what I am starting to see as common behavior, but have no idea where it
came from.
I asked the same about Java developers a few years back. You can tell
those who did Java programming as their first language, because they
define their method names with a lowercase letter to start, but mix the
case throughout the rest of the string (EX: MyObject.someCrazyMethod()
or MyObject.reallyFastSort()). This too seemed peculiar to me, as I so
no purpose for it. Eventually, through some discussion, I think the
group agreed it stems from Sun examples all being written that way.
Jason
Gabe Martin wrote:
shouldn't matter, except for preference. I simply asked, because this is
what I am starting to see as common behavior, but have no idea where it
came from.
I asked the same about Java developers a few years back. You can tell
those who did Java programming as their first language, because they
define their method names with a lowercase letter to start, but mix the
case throughout the rest of the string (EX: MyObject.someCrazyMethod()
or MyObject.reallyFastSort()). This too seemed peculiar to me, as I so
no purpose for it. Eventually, through some discussion, I think the
group agreed it stems from Sun examples all being written that way.
Jason
Gabe Martin wrote:
> I am first and foremost a software developer (not a DB
> Admin\designer). Usually I apply my object oriented point of view to
> my DB designs.
>
> When thinking about this specific problem set what first came to mind
> were the following objects:
>
> A Person
> A Address
> A Person HAS A address
> A soccer player IS A person
> A contact person IS A person
>
> If I wanted to represent these things in an object oriented
> programming language I could create a Person base class and a
> SoccerPlayer, ContactPerson derived classes.
>
> In the same way if I wanted to represent the data for this in a
> database I would create similar tables representing the objects and
> derived objects and join those tables together to get the
> representative data.
>
> Is this the wrong style of thinking for database design?
>
> On 7/27/05, Jason Dodson <jasond@...> wrote:
>
>>Completely Unrelated, but your suggestion of a table named "Person" that
>>is filled with PEOPLE is peculiar... and I am not picking on you, or
>>saying that is wrong. I just noticed throughout my career, and a LOT
>>lately, that tables with PEOPLE stored in them are made with the name
>>"Person" (I also see "Persons"). This isn't once or twice, or five
>>times. If I had to guess, through all of my clients, I have seen this in
>>about fifty databases. Does anyone have a clue as to why?
>>
>>Jason
>>
>>Gabe Martin wrote:
>>
>>>What about this,
>>>
>>>Since both parents and players are people you create a general table
>>>Like so:
>>>PERSON
>>>PersonID
>>>FirstName
>>>LastName
>>>SurName
>>>Sex
>>>ContactID (links to Contact Table)
>>>
>>>Then you can seperate out players and parents (or contacts) via:
>>>PLAYER_RELATIONSHIPS
>>>PlayerID (link to PERSON.PersonID)
>>>ContactID (link to PERSON.PersonID)
>>>Relationship
>>>
>>>If there was other information you wanted to maitain about specific
>>>players you could add another table like so:
>>>SOCCERPLAYER
>>>PersonID
>>>Position
>>>NumberOfGoals
>>>etc..
>>>
>>>This is in addition to a CONTACT table which has all the normal
>>>contact fields as well as a
>>>CONTACT
>>>Address
>>>Suburb
>>>State
>>>etc..
>>>
>>>The reason why you would want to have the ContactID in the Person
>>>table instead of vise versa is because you will probably have many
>>>people (kids and parents) who have the same address.
>>>
>>>Just an idea.
>>>
>>>On 7/27/05, Martijn Tonies <m.tonies@...> wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>
>>>>
>>>>
>>>>>Thanks for your fast response.
>>>>>
>>>>>Do you think if we set-up a table named contacts, containing,
>>>>>name_id
>>>>
>>>>contact_id
>>>>
>>>>
>>>>>firstname
>>>>>surnmae
>>>>>dateofbirth
>>>>>
>>>>>Above table would contain names for players, mother and father. Then
>>>>>somehow, create another table to link player with mother and father.
>>>>>Is it possible?
>>>>
>>>>The do:
>>>>
>>>>PLAYER
>>>>--
>>>>PlayerID (link to Contact.ContactID)
>>>>
>>>>PARENTS
>>>>--
>>>>ParentID (link to Contact.ContactID)
>>>>
>>>>PLAYER_PARENTS
>>>>--
>>>>PlayerID (link to PLAYER.PlayerID)
>>>>ParentID (link to PARENTS.ParentID)
>>>>
>>>>With regards,
>>>>
>>>>Martijn Tonies
>>>>Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
>>>>Server
>>>>Upscene Productions
>>>>http://www.upscene.com
>>>>Database development questions? Check the forum!
>>>>http://www.databasedevelopmentforum.com
>>>>
>>>>
>>>>
>>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>
>>>>Visit http://firebird.sourceforge.net and click the Resources item
>>>>on the main (top) menu. Try Knowledgebase and FAQ links !
>>>>
>>>>Also search the knowledgebases at http://www.ibphoenix.com
>>>>
>>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>>
>>>>Yahoo! Groups Links
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>
>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>
>>>Visit http://firebird.sourceforge.net and click the Resources item
>>>on the main (top) menu. Try Knowledgebase and FAQ links !
>>>
>>>Also search the knowledgebases at http://www.ibphoenix.com
>>>
>>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>>Visit http://firebird.sourceforge.net and click the Resources item
>>on the main (top) menu. Try Knowledgebase and FAQ links !
>>
>>Also search the knowledgebases at http://www.ibphoenix.com
>>
>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>
>>Yahoo! Groups Links
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>