Re: Design question

pepe
Tue, 18 May 2010 13:23:57 -0000

Thanks Tim,

On May 18, 9:12 am, Tim Shaffer
<t...-PGA7PSC7mq/3MY4plGdlAw@public.gmane.org>
wrote:
> I think I would just stick with putting those columns on each table.
> Is there a specific problem you''re trying to solve by abstracting
them
> out to a separate table? Unless you''re trying to remediate a
specific
> issue, this seems like a solution in search of a problem.

I am not trying to solve a problem, I am trying to design a database
that is as flexible as possible. I am trying to abstract
''entities'' to
their own models. In this case the name has the same structure in all
cases and I am thinking it should have its own ''domain''. I am
doing
the same with addresses, although I understand the problem is
different because a person can have more than one address but not more
than 1 name (except for AKAs) or if the person is Jason Bourne... ;)


> > What would be the best/fastest way to query the database with this
design?
>
> The fastest way would be to put the name columns on each table. When
> the names are in a separate table, you have to do a join just to get
> the full record.

I understand that but there are also named scopes, which make your
life much easier than coding manual joins. The question specified
"with this design" hoping somebody would be kind enough to point me
into the right direction if I finally go the route I described.

Thanks a lot.