开发者

Help design a class diagram of a booking system

开发者 https://www.devze.com 2022-12-24 20:31 出处:网络
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

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 IPric开发者_运维技巧eOption(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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号