简体   繁体   English

UML 类图中的数据存储

[英]DataStore in UML Class Diagram

I am doing UML class diagram for the first time.我是第一次做UML类图。 I have put a data store in class diagram I am not sure if I can .我在类图中放置了一个数据存储,我不确定是否可以。 Also, is it possible to get feedback on this class diagram I have uploaded?另外,我上传的这个类图是否可以获得反馈?

Basically its a hotel management system.基本上它是一个酒店管理系统。

I am explaining the story point wise here.我在这里明智地解释了这个故事。 I have removed the unwanted stuffs from the story.我已经从故事中删除了不需要的东西。

1) Login - Allow user to search room if he is a registered user. 1) 登录 - 如果用户是注册用户,则允许用户搜索房间。 If not he/she should be able to register to hotel management system.如果没有,他/她应该能够注册到酒店管理系统。

2)User should be able to search the available rooms from the system and select a type of room-Available rooms based on check in and check out dates. 2)用户应该能够从系统中搜索可用房间,并根据入住和退房日期选择房间类型——可用房间。

3)Hotel employee should be able to charge for the facilities availed. 3)酒店员工应该能够对所使用的设施收费。

4)Store user information for marketing Purposes. 4) 为营销目的存储用户信息。

5)User should be able to cancel made reservation of rooms. 5)用户应该能够取消预订的房间。

6)Make payments online. 6)在线支付。

7)User/receptionist should be able to modify/update rooms booked, User information from the information they have. 7)用户/接待员应该能够修改/更新预订的房间,从他们拥有的信息中获取用户信息。 - I added data store. - 我添加了数据存储。

在此处输入图片说明

  1. Placing login method in the class which gains login does not seem to be reasonable.将 login 方法放在获得 login 的类中似乎不太合理。 Authorization should be a class of its own and a user may gain access through it.授权应该是它自己的一个类,用户可以通过它获得访问权限。
  2. There is nothin modeled which shows the occupation of rooms.没有任何模型可以显示房间的占用情况。 I'd expect some Occupation class which links rooms to time ranges.我希望有一些将房间与时间范围联系起来的职业课程。
  3. The same.相同。 What is the basis for the occupation?职业的依据是什么? There needs to be an Occupation class which relates Room with time frames.需要有一个将 Room 与时间范围相关联的职业类。
  4. What are marketing purposes?什么是营销目的? You could implement some user statistics that traces when a user has booked rooms, how punctual he paid, etc. Those are not modeled.您可以实现一些用户统计信息,跟踪用户何时预订房间、他支付的准时等。这些都没有建模。
  5. Since you have not modeled a Reservation you will not be able to cancel it.由于您尚未对预订进行建模,因此您将无法取消它。
  6. The Payment is related to nothing.付款与任何事情无关。 So you don't know for what a payment was made.所以你不知道付款是为了什么。 Your book keeping will love you for that :-(你的簿记会因此而爱你:-(
  7. As above: no reservation modeled - no modification possible.如上:没有保留建模 - 不能修改。

You should probably find some mentor to sit together and do some basic modeling.你可能应该找一些导师坐在一起做一些基本的建模。

Edit (as on the updated model): This is not the way to go.编辑(如更新的模型):这不是要走的路。 The datastore will serialize the single objects, and not be a class of its own.数据存储将序列化单个对象,而不是它自己的类。 The way you need to do it is to construct a model with the relevant classes.您需要这样做的方法是使用相关类构建模型。 Those will finally result in persistent objects in the database.这些最终将导致数据库中的持久对象。 FacilityAvailed does not look sensible. FacilityAvailed 看起来不合理。 This looks like information you can compute from Reservation (which needs a relation to Room which is now missing completely).这看起来像是您可以从 Reservation 计算的信息(它需要与 Room 的关系,现在完全丢失了)。 Well, you should dump this approach and start all over.好吧,您应该放弃这种方法并重新开始。 Just model the business objects (BO): Room, Reservation, User, Payment, etc. Relate those meaningful.只需对业务对象 (BO) 建模:房间、预订、用户、付款等。将这些关联起来。 What are the attribute of each BO (Room: Number, Size, Cost,... User:Role, Name, ...).每个 BO 的属性是什么(房间:数量、大小、成本、...用户:角色、名称、...)。 Then try to relate them.然后尝试将它们联系起来。 Eg a Reservation may relate Room and User, but could also be simply for refurbishment/cleaning etc.例如,预订可能涉及房间和用户,但也可能仅用于翻新/清洁等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM