• 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
Doubling Up
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Doubling Up


  • Subject: Doubling Up
  • From: Nathan Hampton <email@hidden>
  • Date: Tue, 4 Jan 2005 21:40:04 -0800

I'm grafting a web ordering interface onto a legacy system that uses a SQL Server database on the back end. The way the project is working out, I only have to interface with the database, which is making my life a whole lot easier. Unfortunately, "easier" is a relative term, so I'd love some input on how to handle these.......

1) Right up front, let me tell you that the existing database is a bit bizarre. I didn't design it; I just have to work with it. In this database are two tables containing item information. Both have exactly the same attributes, and are referenced interchangeably from other tables. (Did I mention that there are no foreign key constraints to manage the relationships? Grrrrrr....)

What I'm not sure of is how I should model these tables and their relationships. Is this a place to use inheritance? Horizontal inheritance seems to be closest to what I want, so would I create a superclass which has two subclasses with identical attributes? Alternatively, should I try to fool EOF into thinking that they're really one table by creating a view in the database that is a union of the two tables? If I follow this approach, how much of a load will I be adding to the database server?

If it helps, I only have to read from these tables, not write to them. (I may also need to add duplicates of tables I have to write to, such as the InvoiceHeaderHistory table, which contains historical data from the InvoiceHeader table that I need to write to, but that would be later.)

2) This project will work with four identical databases, each representing one of the company's four locations. I'd like to use the same EOModel for all four, since they have the same structure, but I need to figure out how to connect to the appropriate database on a per-session basis. I think I can get away with making the user specify which of the four locations they use (they're in four different major metropolitan areas, so users are unlikely to get confused about which one to select), but how would I use that information to tell the application which database to use? Or do I need to have four (identical) EOModels, and have the user input select the appropriate model, and, therefore, the relevant database? Or is there another way I haven't thought of?

Any help that could be provided would be greatly appreciated!

--Nathan Hampton (email@hidden)

_______________________________________________
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: Doubling Up
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Open an URL
  • Next by Date: Re: Open an URL
  • Previous by thread: RE: Open an URL
  • Next by thread: Re: Doubling Up
  • Index(es):
    • Date
    • Thread