Re: question on Class Diagram
- From: "Doug Pardee" <dougpardee@xxxxxxxxx>
- Date: 19 Dec 2006 10:29:51 -0800
This sounds like you're doing a homework problem rather than modeling
an actual business, so my response will be oriented toward that.
Federica wrote:
My main concern is how to represent the relation between Segments and Flights ?
Since they have a 1:1 relation
Why do they have a 1:1 relationship? Whenever there is a 1:1
relationship, the two parts could easily be combined into one.
I would think that a segment can only happen on one flight, but a
flight could have multiple segments. If I board Flight 123 from Los
Angeles to New York via Chicago, that is one flight but with two
segments: LA to Chicago, and Chicago to NY. If I board that flight from
LA to Chicago, it is the same flight but my itinerary only has one
segment on the flight in that case.
Similarly, I wonder about the 1:1 relationship between Flight and
Airplane. The same airplane might be used on more than one flight.
Maybe I boarded Flight 123 from LA to Chicago, then the flight number
changed to 246 for the Chicago to NY segment even though it was the
same plane.
In Real Life, it is much more complicated than that. Due to
code-sharing, the same segment can be have different flight numbers
from different airlines. The same airplane will certainly be used on a
number of different flights (if nothing else, the return path almost
always has a different flight number). And each segment will have
multiple itineraries, unless you're only allowing one passenger at a
time!
In Real Life, those aren't nearly enough classes to properly model an
airline booking system. Those are all entity classes; the model is
completely missing its event, description, and role classes. The
absence of the event classes would become glaringly obvious when you
tried to model the many-to-many relationships that exist In Real Life.
.
- Follow-Ups:
- Re: question on Class Diagram
- From: Federica
- Re: question on Class Diagram
- References:
- [Beginner] question on Class Diagram
- From: Federica
- [Beginner] question on Class Diagram
- Prev by Date: Re: looking for a predicate hierarchy
- Next by Date: Re: Transaction Oriented Architecture (TOA)
- Previous by thread: Re: [Beginner] question on Class Diagram
- Next by thread: Re: question on Class Diagram
- Index(es):
Relevant Pages
|
Loading