帮忙设计一个预订系统的类图
我收到朋友的请求,为他的保龄球俱乐部网站编写一个 php 预订系统模块,我想使这个模块尽可能通用,即也可以用于预订台球桌等。
所以我开始起草我的UML类图:
我有2个接口IBookingHandler(具有像BowlingBookingHandler这样的实现)来处理不同类型的预订和IPriceOption(具有像BowlingNormalPrice这样的实现)来处理不同类型的价格。 IBookingHandler 使用 IPriceOption 生成预订的总费用。
数据类“Booking”,代表对象中的预订记录 ata 父数据类“Type”和子类“Lane”,其中具有诸如 etCurrentStock“之类的方法来获取预订类型的实例。
任何人都可以检查此设计,并让我知道哪些地方是错误或缺失的吗?
感谢。James
非常 林
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能希望为客户提供单独的课程。一位客户可能有多个预订。
以正常价格实施是否明智?正常价格是多少?如果他们想要工作日的高级价格和晚上的迪斯科保龄球价格,而在除夕夜他们想要另一个价格怎么办?您不想每次价格变化时都发布新版本。
如果您想将其连接到保龄球道系统(市场上有很多),您可能想了解所有玩家的信息,而不仅仅是预订的玩家。
您收集的客户信息越多,对您的朋友就越好。从此他有了一种廉价而简单的广告方式。
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.