Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Flight that span multiple segments

 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you handle the case where in a flight spans multiple segments(Direct flight with multiple stops)?

Here the 1-1 bi-directional relationship is violated. Multiple segments will refer to 1 flight. But 1 segment always refers to 1 flight

Any Thoughts?
 
Morten Franorge
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the travel industry uses the term Segment in the same way that the retail industry uses "order line", flight (or hotel reservation) being the product.. I hva chosen to include a "route" object/table in my design to facilitate the stop-over flights.. No guarantees as I'm yet to submit my assignment
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Morten,

Thanks for the reply.

How did you achieve the 1-1 bidirectional relationship by introducing the Route Object? Infact I am not sure about the purpose of this Route Object. The user is going to see segments and select seats by segments. My UI will show available seats for all segments in the Itinerary(both one-way and round-trip) in a single screen. So it is up to the user to choose the same seat if available or choose different seats. What is your thought on this?

Actually after thinking about the segment-flight relationship for 2 days, I have decided to add an assumption that "A flight cannot span segments". Afterall the BDM says it is not.

Thanks
Rishi
 
Morten Franorge
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My definition of flight is one that takes off once, and lands once.

The route object is there to "know" about the combination of flights that will take you from A to Z. For each flight there is one segment. An iteniary consists of many segments.
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I completely agree with your definitions about Segment, flight and Route. (Only I defined Route object as Trip object).

But I am not sure if I need Route table. In real world there are various algorithms that can be used to aggregate segments for a selected route. I think this should be done dynamically. If we do this math and store all possible combination of routes in a database table, I am not sure how many thousands/millions of records we might have to store for the entire United States.

So I am assuming that my DAO will take care of this implementation detail.
 
Morten Franorge
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rishi Krishnan:
I am not sure how many thousands/millions of records we might have to store for the entire United States.


That's exactly why I feel the need for a table to store the alternatives. There are two reasons for this.

The algorithme would produce the thousands/millions of alternatives that you mention, making it a performance issue...

The algorithme would probably find a route from LA to SF via NY. That shouldn't be possible...

All IMHO of course...as long as you put it in your assumptions I think you should be ok..
 
Rishi Krishnan
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you've got me wrong. I suggest you google for these algorithms and have a look at them. They will have answers for both of your reasons.
 
Meghana Reddy
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do we need to design the DB tables as well?

Is that for our internal purpose, or do we need to show the database model as well in the documentation?

I am currently doing the assignment.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic