I percievced the domain model as incomplete - remember, it is just the business analyst's version. It describes
one view of the system.
You say you disagree with the bidirectional relationship between flight and segment. But where does it state that it is bidirectional? An undirected association is either bidirectional or undecided. And, seeing how ALL relationships are undirected, I would hazard a guess that they are all undecided. (Besides, I wouldn't trust a business analyst to come up with a correct domain model anyway
)
When analyzing a business domain model, ask youself these questions:
does it include all the required domain objects?are all the defined domain objects required?are the relationships correct? are they necessary? are some missing? You are the architect here. You can change
anything on the model, if you feel justified. I changed, removed and added stuff. And I passed.
You could define a segment as having only two possible values, "in" and "out". You could introduce the concept of a leg, and saying that one segment has 1..n legs, and one leg has one flight. That would change the domain model to be more consistent with your understanding of the business, but it would also introduce one more domain object to the model, thereby increasing the complexity of the system.
Your "segment" domain object is little more than a boolean, stating "true" and "false". Maybe you could move it to the Itinerary and/or Leg domain objects, as a property of these?
Moving it to the Itinerary - this would state wether or not the journey is a one-way or a roundtrip. Does this add value? Not much, no.
Moving it to the Leg - you could very well have a property stating wether or not this segment is part of the "out" or "in" segment (your definition). This could be said to add some value, enabling you to lose the Segment domain object entirely, simplifying the model. But do you really need that information to be stated explicit? Maybe. Up to you.
So, if you do this, you have Itinerary-Leg-Flight. Apart from Segment being changed to Leg, identical with the business analyst's model.
Now, the Leg-Flight relationship as undirected 1:1. One Leg has one and only one Flight, that is fine. But, how many Legs does one Flight have? Navigating the direction Flight-Leg-Itinerary-Customer, how many customers can be on one Flight?
[ January 25, 2008: Message edited by: �dne Brunborg ]