Re: question on Class Diagram



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.

.



Relevant Pages

  • Re: question on Class Diagram
    ... Since there are multiple ways to do that one would be ... (for example the field "flight" in the Segment class). ... an actual business, so my response will be oriented toward that. ...
    (comp.object)
  • Re: Your Experiences With Ryanair: Do Fares Eventually Get Lower?
    ... I'm looking into getting a Ryanair flight from Germany to Italy this ... One of the segments is a lot cheaper than the other. ... should I get the cheap segment of the flight now ...
    (rec.travel.europe)
  • Re: Train carrying Shuttle booster segments derails
    ... I suppose its at least good that no packed passenger train was involved. ... I was just wondering about the flight integrity, surely the segment is ...
    (sci.space.shuttle)
  • [Beginner] question on Class Diagram
    ... I have to draw a class diagram about an airline company. ... Flight: holds flight information ... Airplane: holds airplane information. ... Since they have a 1:1 relation it seems to me that Segment holds ...
    (comp.object)
  • Re: Real Flight G3
    ... Your computer system should run G3 plenty smoothly. ... comment about planes not bleeding off speed in a realistic manner also rings ... G3 doesn't model slow flight ... >> throttle with a Nexstar or PT40 in real life than it is on the sim. ...
    (rec.models.rc.air)

Loading