0

Just wondering if anyone can give me feedback on my class diagram. I want to make sure it's correct and also any changes that are needed to it.

Thanks

Image link: https://i.stack.imgur.com/k4RA2.jpg

enter image description here

Sandeep Bansal
  • 6,280
  • 17
  • 84
  • 126
  • Hard to say without knowing your problem. But: should a ticket know its booking (bidirectional association)? And should payment be connected to something - user or ticket or ...? – Erik Apr 22 '11 at 23:22
  • What question are you asking? – amelvin Apr 22 '11 at 23:23
  • @Erik, my problem is that I'm unsure about the associations, I just need to understand where I'm making the mistakes so I can correct them. @amelvin, I just want to know if the diagram makes sense and if there's any that needs to be changed – Sandeep Bansal Apr 22 '11 at 23:24
  • Also: where I come from methods like addBooking, editBoking etc are not part of the class diagram. They exist in other layers, not in the model. – Erik Apr 22 '11 at 23:24
  • Oh right ok, I need to keep the operations in the class diagram, just for design analysis – Sandeep Bansal Apr 22 '11 at 23:26
  • I have created an arrow to and from Booking and Ticket, and also created an association from Payment to User with a 1..* is there anything else – Sandeep Bansal Apr 22 '11 at 23:33
  • Why do you have n at the end of the association and not * ? – UML GURU Apr 23 '11 at 10:08
  • Was just what Rational rose put, I was going to change them after I got feedback from here – Sandeep Bansal Apr 23 '11 at 11:25

1 Answers1

1

Difficult to provide a definitive answer without knowing the specific rules & requirements of your domain. However: assuming there's nothing unusual, some observations:

  • Can there be multiple performances of the same show? e.g. "Glee" being performed on Fri, Sat & Sun eve. If so you may want to separate out 'Performance' from 'Show'. (Each Show is performed many times, a Performance performs exactly one Show). Bookings are typically for a specific Performance, not the Show.
  • How do you know which seats are in which venues? More specifically, which seats in which venues are booked for which performances, and which seats remain free? Suspect you're missing one or more relationships among Seat, Venue and Show (Performance).
  • How do you know which Seat, Venue and Performance each Ticket applies to? (Generally speaking, a Ticket will have all of those printed on it).
  • Is it really OK to make a single Payment for many Bookings? (It might be, just checking).

More generally I'd recommend naming the association ends - preferably with verb phrases, not role names. It really helps readers understand the relationships - as well as helping you (the modeller) ensure you understand the domain.

hth.

sfinnie
  • 9,854
  • 1
  • 38
  • 44
  • Thanks this does help, to make it understandable, it is a Theatre Booking. Each show is booked at a different venue at a different date, more than one showing can be at a venue but not at a specific date. the seat will contain a showID, to know which show the seat is a part of, unless this isn't the way to go about it. for the bookings, I was gathering that more than one booking can be made where a payment can be made for that whole amount. – Sandeep Bansal Apr 23 '11 at 11:27
  • OK, so your "Show" is I think what I was referring to as "Performance". If that's so, I'd still assume you'd want to know all the Shows of the same kind ( to answer questions such as "I'd like to see "Grease", can you tell when & where it's on?). With regards seats. If the seat contains a Show ID then you have a relationship between Seat and Show. (ctd...) – sfinnie Apr 23 '11 at 20:47
  • The 'Seat' is really a 'Seat Reservation' for a particular show. In which case, how do you know which physical seat it's booking? Again, I'd expect you'd need separate classes for the physcical seat (row 1, seat 3 in venue A) and a booking of that seat for a particular show. I've used this problem (or at least a very similar one) when running training classes. The secret to a good solution is to focus on the relationships. – sfinnie Apr 23 '11 at 20:52
  • Thanks, that was very detailed and descriptive, certainly helped, the main idea was to have a database table with a seatId venueId and a seatNumber this is where the class came in to do that, I do understand what you are on about, and maybe will get through the rest, as long as my relationships are on the right track then I'll get through it. I'll also have to take reference to my UML book. Thanks again. +1 and accepted. – Sandeep Bansal Apr 23 '11 at 20:57
  • Glad to help, thanks for the rep. Good luck with your modelling. – sfinnie Apr 23 '11 at 22:02