• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Segment, flight, Airport

 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've three classes Segement, Flight and Airport. Segment class holds origin and destination airport. Flight has other details like flight number, capacity, total price etc. Now i'm confused where to link airport to (segement or flight). Logically speaking it should link to Segement.

But i have one more class City which is linkedto airport indicating the cities an airport serves.

With this, if i link segment and airport together, then a segment is serving a city rather than the flight (which may have one or more segments).

Please clarify where should i link airport to - either segment or flight.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As i understand in your case city is linked to airport. Why would a city link to segment ? An airport will be served by a segment and an airport serves one or more cities.
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't understand what you concluded. Pls elaborate.
 
kavita varun
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
**With this**

I thought you mean segment is linked to city may be not. If i read it now may be you where right about the question.

Can we say the segment is 'serving' city but flight is 'offered' for
the segment ?
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is something which is missing i feel.

When we take a flight, it''s flight which is reaching us to destination. Not segment. Segment is internediate stop in the journey.

So, actually it's flight which takes us from origin to destination. If we consider like this, then city should get linked to flight thro' airport.

i'm really confused. can somebody clear this.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Origin to Destination is a segment and flight just takes you from origin to destination.

So i think u r initially right that segment should have origin and destination rather than a flight!!!
 
Laxmi Raghu
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the info. I did that way only in my assignment solution. I didn't feel correct to link to flight. Thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic