I think you are correct. We do not need to persist Unpaid Itinieraries.
But this also means that "Change Itinerary" will allow changes to Paid Itineraries. Isn't it ?
The customer looks at all the itineraries, drills down to segments, and then deletes a segment and system takes the customer to prepare itinerary.
To provide this workflow:
(a) Either system should allow changes to paid itineraries OR
(b) System should save upaid itineraries in the database and allow modifications to those.
If we are not doing one of the above then I think we are not even covering what has been mentioned in the use case.
Because allowing changes to unpaid itineraries, which is still in session does not meet the workflow mentioned in the usecase.
Originally posted by Josep Andreas:
Yes, thanks,
I was a bit too hasty with my assumptions...
cleaned up the class diagram pretty good though
Regards,
J
Are you also thinking of
(a) Either allowing user to modify the paid itineraries.
- this will require some logic around credit/debit of credit card/frequent flyer
(b) OR allowing user to save unpaid itineraries and then change them.
- this will require some cleanup of unpaid itineraries after certain elapsed days/hours
In my design I am opting for option (b).
As only paid itineraries are persisted in my design (Unpaid seats are also stored in shopping cart),
I was thinking of:
1. you start a Transaction on the ejb context. (e.g. in facade)
2. Create itinerary/segments/reserve seats. (set ejb entity Beans (CMT) to transaction required; so they use this transaction)
3. Do payment (by CreditCard or to Mileage account)
4. If payment not successfull-> throw exception/rollback
5. else commit transaction
Options for reserved seat issue:
A If in step 2, the seat (that was previously free) is reserverd now by someone else, You throw an exception, handle it and let e.g. the user select another seat
B leased lock solution as described by Ramesh, but then indeed you need the
entity bean to store it.
Dhiren,
I assume that in your shopping cart you have a collection
that holds on to composite ItineraryTO's (which has segements and seats)?
This Composite ItineraryTO (POJO) would be the only input for making it a real itinerary,
since it contains ItineraryInfo,segments and seats.
Are you showing this ItineraryTO as a separate class in your diagram?
this design is also used in Petstore
the Collection of ItineraryTO's (in the shopping cart) are used for storing the unpaid itineraries,
right?
Do you show them In class diagram. I am not sure if this is necessary?
You could just show attribute in the shopping cart.
In cade's guide they aren't, but there the TO is only used for communication between web tier and business tier.
I do not understand how your seats are persisted in DB this way.
Maybe you can explain.
(Petstore uses same design for shopping cart:
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/sample-app/sample-app1.3.1a3.html
The cartItems are plain TO's and no CompositeTO.. ( but thats a detail..))
I'm still in control here. LOOK at this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|