File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Route - Flight - Segment again. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Route - Flight - Segment again." Watch "Route - Flight - Segment again." New topic
Author

Route - Flight - Segment again.

Jesse Jesse
Greenhorn

Joined: Dec 08, 2005
Posts: 10
Hi I realize this is a very old topic, I have being looking at a few posts, thought I would put my design out there to see if I am on the right track.

Basically I see a Segment as a line item on an Itinerary (similar to the relationship between an order and orderline). The segment holds information such as the flight details - arrival airport, destination airport price etc obtained through its association with flight and also has the seat no, and passenger details.

I see a flight as a trip between an arrival and destination airport i.e. on take off and one landing. Therefore since the flight class represents all flight instances I see there is a need for a higher level object that groups flights together in order to get from point a to point b offering various options to the customer i.e. for indirect flights this could contain two or more flights possibly or direct 1 flight etc.

Any comments would be appreciated

Thanks
Arvind Patel
Greenhorn

Joined: Nov 28, 2005
Posts: 23
I too is preparing for SCEA part 2.
This is what I think.


Basically I see a Segment as a line item on an Itinerary (similar to the relationship between an order and orderline). The segment holds information such as the flight details - arrival airport, destination airport price etc obtained through its association with flight and also has the seat no, and passenger details.

- So there will be passenger details per segment ?
Would this duplicate the passenger info. May be you can put it at itinerary level and still store the booked seat info at segment level.


I see a flight as a trip between an arrival and destination airport i.e. on take off and one landing. Therefore since the flight class represents all flight instances I see there is a need for a higher level object that groups flights together in order to get from point a to point b offering various options to the customer i.e. for indirect flights this could contain two or more flights possibly or direct 1 flight etc.

-- Where do you plan to put this generalized class.


Arvind.

Thanks


Arvind.<br />SCJP, SCWCD, SCBCD, SCDJWS, SCEA
Arvind Patel
Greenhorn

Joined: Nov 28, 2005
Posts: 23
I too is preparing for SCEA part 2.
This is what I think.


Basically I see a Segment as a line item on an Itinerary (similar to the relationship between an order and orderline). The segment holds information such as the flight details - arrival airport, destination airport price etc obtained through its association with flight and also has the seat no, and passenger details.

- So there will be passenger details per segment ?
Would this duplicate the passenger info. May be you can put it at itinerary level and still store the booked seat info at segment level.


I see a flight as a trip between an arrival and destination airport i.e. on take off and one landing. Therefore since the flight class represents all flight instances I see there is a need for a higher level object that groups flights together in order to get from point a to point b offering various options to the customer i.e. for indirect flights this could contain two or more flights possibly or direct 1 flight etc.

-- Where do you plan to put this higher level object .


Arvind.

Thanks
Vagner Freitas
Ranch Hand

Joined: Aug 02, 2004
Posts: 85
Hi Jesse,

I see Segment as a line item on a Itinerary too.
But I see a Flight as flight number, and each Flight has 1 or many Legs.
For instance, Flight 3370 has Legs A -> B, B -> C and C -> D.
Then, Customer X can buy the seat number 14C in the Legs from A to C, and Customer Y can buy the same seat 14C in the Leg from C to D.
I introduced a class Reservation, that associate Segment, Leg and Seat.
What do you think?

Vagner


SCJA, SCJP, SCBCD & SCEA (Part I)
Jesse Jesse
Greenhorn

Joined: Dec 08, 2005
Posts: 10
Hi Guys, thanks for the response.

I am still running over all of this in my head trying to come to a solution given that the requirements contain a high level of ambiguity and trying to understand why certain BDM associations are defined as such.

Vagner in response to your post:


I see Segment as a line item on a Itinerary too.
But I see a Flight as flight number, and each Flight has 1 or many Legs.
For instance, Flight 3370 has Legs A -> B, B -> C and C -> D.
Then, Customer X can buy the seat number 14C in the Legs from A to C, and Customer Y can buy the same seat 14C in the Leg from C to D.
I introduced a class Reservation, that associate Segment, Leg and Seat.
What do you think?


I think I see what you are getting at. I think it is something along the lines of what I am thinking of. One question though, will you still have an association between segment and flight and what data would you hold in leg?

From other posts I came across a link defining travel terminology ->

Travel Terminology

After reading this I see Segment and leg as having the same meaning when used in that sense ( one take off and landing). When I consider the one to one association between a Segment and Flight I say to myself why!, as I can't see the reason for it as I consider flight also to have the same meaning as segment one take off and landing. Therefore this implies that a segment given its definition will have the same attributes as a flight for its take off and landing. This raises two interesting choices for me if there is to be a one to one association between flight and segment then flight does not hold the origin and destination only flight number etc and we search on segments using an object that aggregates segments into a route when a customer wishes to search for flights.

If a flight is to hold the destination and arrival then the second option we search by flight and change the association between segment and flight to flight 1 segment 1 ..*. And in this sense, segment is simply a booking line on the itinerary. As a flight can have many segments (seat reservations).


Hi arvind in respone to ur post.

- So there will be passenger details per segment ?
Would this duplicate the passenger info. May be you can put it at itinerary level and still store the booked seat info at segment level.


Yep I was thinking that myself but this asks the question what happens if there is multiple passengers being booked by the same customer. I guess it comes down to how the seat selection is implemented if the customer simply selects coach or first class which I think should probably selected when the initial search is carried out or if there is a more in depth seat selection option that would require the passeneger to be explicity coupled to each section.


Where do you plan to put this higher level object


Here it depends on I guess what I am going to search - either segment or flight, as commented on in response to wagner


Maybe I am missing something simple here ...

Look forward to your responses.

Jesse
Sri Jag
Greenhorn

Joined: Oct 28, 2005
Posts: 9
The way I understood it:

1. An Itinerary can have 1 departure, 1 return and multiple layover segments where layover and return may be optional.

2. A Segment is one take-off and one landing, but on no specific date or time - just between specific cities.

3. A Flight qualifies a Segment as a take-off and landing on a particular departure day at a particular departure time.

A Segment can be fulfilled only by one flight at a time, but that does not preclude the Segment from being fulfilled by different flights at different times. For instance, from JFK-IAD, you could fly on a Boeing 737 at 10:00 AM tomorrow (Flight No. 1234) whereas your wife could take the same Segment at 11:00 AM on an Embraer Jet (Flight No. 5678)- same Segment, different flights, different aircraft. The equipment doesn't necessarily have to be different - they could both be Boeing 737s with different Flight numbers.
Jesse Jesse
Greenhorn

Joined: Dec 08, 2005
Posts: 10
Thanks Sri.

That's more or how I understood segment to be, but if we follow a one to one association between Segment and Flight, then it seems a requirement to introduce an additional class between Itinerary and Segment to track seat number etc, as if a Segment holds the seat number the multiplicity between segment and flight needs to be changed as there would be multiple segments related to a flight i.e.

customer1 books segment1 - Krakow to Poland with seat no 12 for flight fr333

customer2 books the same segment, segment1 - Krakow to poland with seat no 112 for flight fr333

Also in this context if the segment only holds the departure and arrival city, no seats etc, then this breaks the business rule implied by the one to 1:m association between Itinerary and Segment as Segment can now really belong to more than one Itinerary, given that introducing a new class also breaks this association.

But if we consider a Segment as a reservation line item on an Itinerary and introduce a Flight Description class (holds flight number departure city, arrival city one take of and landing) that is associated to flight (scheduling of a trip date and time) which models the same semantics as segment and flight. Also I was considering introducing the concept of a FlightPlan and possibly another concept to group flights together to fulfill a journey that takes multiple segments (flights in this case).


look forward to your response


Jesse.
b deb
Greenhorn

Joined: Mar 17, 2005
Posts: 8
Hi All,

From what I have seem in most of the posts, we shouldn't change the BDM given in the assignment much. Can we atleast change the cardinality between different domain objects ?

Thanks,
Bdeb
Maris Orbidans
Ranch Hand

Joined: Mar 08, 2004
Posts: 149
1-1 cardinality between Equipment (plane) and Flight is not correct.
One plane can have many flights not just one.

The same thing with Flight - Segment. One flight can have many segments.

And from Change Itinerary use case details I understand that segment is reservation of a flight.
Parag Bharambe
Ranch Hand

Joined: Jan 12, 2006
Posts: 57
If we look at Domain model from Customer to Seat classes one by one then following cardinality seems ok to me.
I think for one segment there should be only one flight. So Segment-Flight should be 1:1 is ok.
One flight can have only one equipment. (1:1 OK)

But if I look at Domain Model in general (pieces) then the cardinality is definitely not correct. I agrees to Maris has mentioned above.

1-1 cardinality between Equipment (plane) and Flight is not correct.
One plane can have many flights not just one.

The same thing with Flight - Segment. One flight can have many segments.

So in assignment which one we shall use?
b deb
Greenhorn

Joined: Mar 17, 2005
Posts: 8
My understanding of itinerary/segment/leg/flight/equipement is .....

-An Itinerary can have 1 departure, 1 return. Return is only optional. Will have reference to segment(s),reference to customer,total itinenary price. Has 1-many relationship with segment.

-A Segment is from departure place to the end destination, with optional lay over in between. Thus for one-way trip an itinerary will have 1 segment only, while round-trip will have 2 segments. Segment is a line item in itinerary ( like order and orderitem). Will have details like start city, destination city, departure time and date, arrival date and time, price (for the segment), segment distance, reference to intermediate legs. Has 1-many relation ship with leg.

- Leg is one take-off and landing. Thus a segment can have multiple legs. For 1 leg a segment, leg and segment becomes same. Price is set against segment and not individual legs. Will have details like start city and destination city (for individual leg), leg distance, reference to flight. Has 1-1 relationship with flight.

- Flight qualifies a leg as a take-off and landing on a particular departure day at a particular departure time. Will have details like flight no, start time and date, arrival time and date, reference to equipement. Relationship between flight and equipement (plane) is many to 1.

- Equipement has 1-many relation with seat.

Want to validate that with u guys ..... problem is - where do i fit in the seat for each leg that customer has selected.
Jesse Jesse
Greenhorn

Joined: Dec 08, 2005
Posts: 10
Hi Guys

I think the 1:1 association between an Equipment and Flight is ok. My reasoning being a flight can only have one Equipment at a specific point in time but this does not stop a flight from having a different Equipment at a different time.

I have read on other posts that people who have changed the cardinality of BDM associations have got as good a mark, if not better than people who have not changed it as long as you justify your assumptions in the documentation.

I see segment and leg as meaning the same thing.
IF I agree with the assumption that a segment simply represents one take off and one landing (departure airport, arrival airport)that is qualified by a flight(flight no. price etc as travel terminology suggests and if I agree with the association between segment and flight as being one to one then this implies that a new class needs to be introduced between segment and itinerary to track a customers reservation for a particular segment including seat reservation etc. But then what's the point then of having an extra association between itinerary and segment?. However if I change my model so a flight can have many segments(Seat reservations for a flight) then in my view - so far, this simplifies the model.

All in all I think this assignment is to ambiguous for its own good. If the concepts where cleanly defined it would save so much bother especially given there is no customer to aid in analysis etc - it kind of puts me off the whole assignment. At the end of the day if our assumptions are properly documented and it supports the needs of the business how can you fail unless of course the examiner wants to see certain terminology defined within the model i.e. segment which I think would be very harsh.


Look forward to your thoughts.

Jesse
Sri Jag
Greenhorn

Joined: Oct 28, 2005
Posts: 9
Originally posted by Jesse Jesse:

I think the 1:1 association between an Equipment and Flight is ok. My reasoning being a flight can only have one Equipment at a specific point in time but this does not stop a flight from having a different Equipment at a different time.



However if I change my model so a flight can have many segments(Seat reservations for a flight) then in my view - so far, this simplifies the model.


If a Flight can have many segments AND if a Flight can have only one Equipment associated with it at a time, then are you presuming that all segments in the Flight would be flown using the same equipment? The relationship between a Flight and multiple Segments would exist at the same point in time as the relationship between a Flight and Equipment - the Itinerary is not going to be updated mid-travel to reflect the changes in Equipment.


IF I agree with the assumption that a segment simply represents one take off and one landing (departure airport, arrival airport)that is qualified by a flight(flight no. price etc as travel terminology suggests and if I agree with the association between segment and flight as being one to one then this implies that a new class needs to be introduced between segment and itinerary to track a customers reservation for a particular segment including seat reservation etc.


I think this is more reasonable. BTW, I need to correct the original assumption I made - an Itinerary can have only 1 Departure and 1 optional Return. If you call each of these a "Reservation Line Item", then the association between Itinerary and Segment could be removed. If you compare the Prepare Itinerary and Change Itinerary use cases, you will see that the terms "flights" and "segments" have been used in a conflicting manner. Introducing a "Reservation Line Item" class seems to be the best way to go as far as I can tell.

Additionally, a Segment can indeed have many Flights (going by my earlier assumption of a Flight "qualifying" a Segment by Date, Time and Flight No.) because the same Segment is going to be used in multiple itineraries (by different Customers) for different Flights. The Segment would then have to be aware of all the Flights that are servicing it (obviously for searches to work).

Jesse Jesse
Greenhorn

Joined: Jun 04, 2004
Posts: 22
Hi Sri

If a Flight can have many segments AND if a Flight can have only one Equipment associated with it at a time, then are you presuming that all segments in the Flight would be flown using the same equipment? The relationship between a Flight and multiple Segments would exist at the same point in time as the relationship between a Flight and Equipment - the Itinerary is not going to be updated mid-travel to reflect the changes in Equipment.


Yep, sorry I didn't make myself clear enough here - it has to do with the way I view a segment. In my design I decided to have segment as a line item on an itinerary which reserves a seat one flight and a flight can have many segments (Seat reservations). However the segment no longer contains the arrival and departure city I opted to move this to another concept associated to flight. This means I no longer have to introduce another concept associated to itinerary and linked to segment making the link between segment and itinerary redundant.


I think this is more reasonable. BTW, I need to correct the original assumption I made - an Itinerary can have only 1 Departure and 1 optional Return. If you call each of these a "Reservation Line Item", then the association between Itinerary and Segment could be removed. If you compare the Prepare Itinerary and Change Itinerary use cases, you will see that the terms "flights" and "segments" have been used in a conflicting manner. Introducing a "Reservation Line Item" class seems to be the best way to go as far as I can tell.

Additionally, a Segment can indeed have many Flights (going by my earlier assumption of a Flight "qualifying" a Segment by Date, Time and Flight No.) because the same Segment is going to be used in multiple itineraries (by different Customers) for different Flights. The Segment would then have to be aware of all the Flights that are servicing it (obviously for searches to work).


I agree with you and see where you are coming from with your design that a segment can have more than one flight and the relationship between a segment and a itinerary is redundant when you introduce a reservation. However I guess it comes down to your design choice I opted for a different design as described above which means I can now link segment to a reservation. I see this as simpler for the time being, I will document my decisions and hope for the best.


Thanks

Jesse


SCJP, SCJD, SCWCD, SCBCD
Anand Bakwad
Greenhorn

Joined: Dec 13, 2005
Posts: 7
I don't think segment is necessarily required here. We all are cosidering the BDM provided here. But don't think of it, think on your own. Segment is a logical term in my opinion.
A person can have zero or more itinerary.
An itinerary can have one or more than one flights..one flight will have one equipment and an equipment can have one or more than one seats.
In this segment is first take off and first landing. That doesnt make much sense to consider segment.
let me know if I am correct or wrong
Morten Franorge
Ranch Hand

Joined: Jul 29, 2005
Posts: 137
Is there any thing in the use case or otherwise that leads us to believe that the system should handle layovers? The only place I can see a hint is where it says "customer selects flights", however I think that is refering to the departure and return, and not the lay overs...?


SCJP 1.4, SCBCD 1.3, SCBCD 5.0, SCEA J2EE, SCEA 5.0
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Route - Flight - Segment again.