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

Itinerary contents

 
Manny Pacman Pacquiao
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which one is true?

1. An Itinerary contains at most 1 departure flight and the return flight(if two way)

or

2. An Itinerary contains many departure flights and the return flights(if two way), in this case the Itinerary is like a shopping cart. In my design I didn't use this idea... things are getting difficult because of this. Need help please. I really need to see the initial Domain Model again...
 
Beppe Catanese
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manny

my interpretation of the BD is the following:

Itinerary would AMS-NY return

Segments:
AMS-Rome
Rome-NY
NY-Rome
Rome-Ams

Each segment is covered by one flight:
AMS-Rome KL101
Rome-NY BA7
NY-Rome BA8
Rome-Ams KL103

So I model:
relationship itinerary-segment as 1:n
relationship segment-flight as 1:1

I've seen a discussion (http://www.coderanch.com/t/153536/java-Architect-SCEA/certification/Passed-Part) about changing the cardinality of the relationship segment-flight.... but to be honest I like the approach I take, seems straight forward to me.

Hope this helps.

Beps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic