• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Database Design - Multiple locations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Database Design - Multiple locations


  • Subject: Re: Database Design - Multiple locations
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 21 Apr 2008 12:45:08 -0700


On Apr 20, 2008, at 6:15 PM, Mr. Frank Cobia wrote:

I have a database design question. I am posting it to the WebObjects list because I am building a WebObjects app and want a solution that works well for EOF.

I have a table of data that has to have a location associated with it. Unfortunately the level of the location is not constant. The data can be associated with a Country, Region, State, Metro Area, County or City. Each of those levels is its own table with relationships pointing to the related locations. i.e. a State knows which Region it belongs to and which Metro Areas belong to it.

I have been unable to come up with a design that seems elegant. I have thought of having 6 separate relationships to each of the location levels, but it seems to duplicate data and the data could get out of sync if a state is moved to a different region or a City is moved to a different county.

Has anyone had a situation like this and come up with a good solution?


This seems like a good place for inheritance with an abstract EO of Location with concrete subclasses of Country, Region, State, Metro Area, County or City. For some operations, having them in separate tables might cause more fetches than you want. Using single table inheritance would address that.

Chuck

--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Database Design - Multiple locations
      • From: "Mr. Frank Cobia" <email@hidden>
References: 
 >Database Design - Multiple locations (From: "Mr. Frank Cobia" <email@hidden>)

  • Prev by Date: Re: Access to D2wContext / RuleSystem while rendering
  • Next by Date: Re: ERXMutableArray fields in Entity Modeler
  • Previous by thread: Re: Database Design - Multiple locations
  • Next by thread: Re: Database Design - Multiple locations
  • Index(es):
    • Date
    • Thread