Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #72

Re: Designing a structure

From "Marco" <marco@THRWHITE.remove-dii-this>
Subject Re: Designing a structure
Message-ID <93ecbfa7-ed35-4210-8192-fdbd9835a98e@t54g2000hsg.googlegroups.com> (permalink)
Newsgroups comp.lang.java.databases
References <j0n024lu78vvaoo46ac92n8lb5h623gkiv@4ax.com>
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.databases,comp.lang.
On May 6, 4:22 pm, David Segall <da...@address.invalid> wrote:

> Thanks Arved. I agree that the application probably reduces to a
> many-to-many relationship between persons and businesses in one table
> and locations in another and that does lead to the difficult and
> probably off-topic question of designing a GUI to represent that
> relationship.

Not impossible to implement in a user-friendly way: on the edit form
of one person the user sees the list of addresses and the "+" button,
which leads to the address entry form. After the user clicks "OK" on
the latter, the application checks whether the address already exists
or not (even by applying some euristics, e.g.: "High St." is supposed
== to "High Street"), and proposes to select among possibly equivalent
addresses. New address is only added (and a record on the bridge table
with it) if no existing one exists or none is selected by the user.


> In my sheltered world of designing databases for small
> businesses I have been able to insist that the rows in each table are
> present before the user specifies a many-to-many join. I don't think
> that is practical for an address book.
>

It's not practical in your case, since the bridge table conceptually
doesn't belong in the high level object model, it is something needed
at the relational level, to overcome the limitations of the relational
model. So it's not wise to show it to the user.

> It is true that the many-to-many "personal relationships" are ideally
> represented by a separate junction table but I don't think that I can

See above. The junction (or bridge) table is indeed the only way to
truly represent a n-m relation on the SQL side. Or at least the
canonical and most efficient one.

> expect a user to enter those relationships and I am prepared to accept
> that my database will not be able to associate two people who do not
> share a location.
>

You could have Person->Address as 1-1 or 1-n relation, and you could
later compute relations like "live together" by analysing the
addresses of two people. And propose to the user to confirm they live
together. Would be more powerful, for it could be generalized into
"they don't leave together, but are friends", the first step in
evolving your address book application toward a Social Networking
application...

> Thanks to the posts in this thread I now realize my original question
> was wrong. What I am really looking for is a "true and correct :)"
> data model for the _user_ of this many-to-many relationship. Failing
> that, I have some ideas for a GUI but they are really clunky and
> involve Outlook/Thunderbird-style tabbed panes with an added drop-down
> list to enable the user to select existing data.

I would give a look to to existing models of this type and I would be
at least curious of modelling approaches which are more expressive
than SQL (e.g. ORM, XML or RDF/RDFS/OWL).

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Designing a structure for "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: Designing a structure "Ed Prochak" <ed.prochak@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: Designing a structure "Martin Gregorie" <martin.gregorie@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Ed Prochak" <ed.prochak@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Arved Sandstrom" <arved.sandstrom@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: Designing a structure "Ed Prochak" <ed.prochak@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
            Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
              Re: Designing a structure "David Cressey" <david.cressey@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
                Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
              Re: Designing a structure "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
                Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
                Re: Designing a structure "Ed Prochak" <ed.prochak@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
                Re: Designing a structure "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
                Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
            Re: Designing a structure "Gene Wirchenko" <gene.wirchenko@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: Designing a structure "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
    Re: Designing a structure "Arved Sandstrom" <arved.sandstrom@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: Designing a structure "ram" <ram@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: Designing a structure "Arved Sandstrom" <arved.sandstrom@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Lew" <lew@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
      Re: Designing a structure "David Segall" <david.segall@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
        Re: Designing a structure "Marco" <marco@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
          Re: Designing a structure "Arved Sandstrom" <arved.sandstrom@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000
  Re: Designing a structure "Marco" <marco@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web