Is there a composite relationship between Itinerary and Segment?

Joe Nguyen

Ranch Hand

Posts: 161

posted 11 years ago

I just begin to do part II and would like to get people's opinions about the relationship between Itinerary and Segment.

Since Itinerary has 1...Segments and a Segment can be an Itinerary (in this case Itinerary has exactly 1 Segment), Itinerary can be viewd as a composite and Segment as a leaf. When a customer would like to change the existing Itinerary, Customer selects the segment to change. In order to change, the segment is deleted and the Prepare Itinerary Use Case is executed. Using composite relationship, the pricing would be easy to calculate.

Joe Nguyen

Ranch Hand

Posts: 161

posted 11 years ago

I mean Itinerary has 1...many Segments. To calculate the price, the getPrice() method will be invoked on the component.

Chandramouli Ram

Ranch Hand

Posts: 65

posted 11 years ago

Hi Joe,

In my opinion, the analogy to a general eCommerce site is: Itinerary is Order while segment is a line item. So, if you say Itinerary is a composite, I believe you are right.