views:

190

answers:

1

Hello guys,

I got a request from my friend to write a php booking system module for his bowling club website, I am thinking to make this module as generic as possible, ie can also be used for booking pool tables etc.

So I started to draw up my UML class diagram:

I have 2 interfaces IBookingHandler(has implementation like BowlingBookingHandler) to handle different types of bookings and IPriceOption(has implementation like BowlingNormalPrice) to handle different types of prices. IBookingHandler uses IPriceOption to generate the total cost of the booking.

A data class "Booking" which represent a booking record in object A ata parent data class "Type" and subclass "Lane" which has methods like etCurrentStock" to get instances of types for the booking.

Could anyone please review this design, and let me know what things are wrong or missing?

Much appreciated.

James Lin

A: 

You probably want a separate class for the customer. One customer could possibly have multiple bookings.

Is it wise to ha a implemenation for normal price? what's normal price? what if they want senior price during weekdays and disco bowling price during the evenening, and on new years eve they want another price. You don't want to release a new version everytime the price changes.

If you want to connect it to the bowling lane system ( there are plenty of them on the market) you probably want to have knowledge of all the players not just the one making the booking.

The more customer info you collect the better for your friend. Since he then have a cheap and easy way of advertising.

Richard L
Hi the IPriceOption is for different prices, eg, customers can buy different types of games, normal 1 game price or buy 1 get 1 game free price, of course there will be specials etc, reason I want to do it in class is every special is different, and requires different calculation and conditions. But critism is most welcome!
James Lin