如何在 UML 类图中表示报表
我正在研究宾馆管理系统。 每天、每周和每月生成不同的报告。 例如,我的房间类别包含房间号、租金等。房间入住报告根据公式每周生成 (房间入住率=总入住房间数/房间总数)
我如何在我的类图中表示此报告或任何其他报告,或者我是否需要将其包含在我的类图中?
I am working on guest house management system.
Different reports are generated on daily, weekly and monthly bases.
for example i have room class which contains room no, rent etc.. room occupancy report in generated on weekly bases according to formula
(room occupancy=total room occupied/total number of rooms)
how do i represent this or any other report in my class diagram or do i need to include it in my class diagram?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您觉得需要有一个具体的表示,您可以创建一个
RoomReport
类。您还可以拥有一个用于创建报表的ReportFactory
。如果它有利于软件创建过程,请将其添加到您的 UML 中。如果您认为纯粹性、正确性或“这是必需的”是您这样做的理由,那么您这样做的理由是错误的。
UML是软件开发人员和流程中的利益相关者之间沟通的符号,而不是某种要服务的严格流程。
You can create a
RoomReport
class if you feel the need to have a concrete representation for it. You can also have aReportFactory
that houses the creation of reports.Add it to your UML if it benefits the software creation process. You're doing it for the wrong reason if you think that purity or correctness or "it's required" is your justification for doing so.
UML is a notation for communication between software developers and stakeholders in the process, not some rigid process to be served.
报告是其他类的输出,通常没有自己的行为,因此它们通常不会在 UML 图中表示。您可能有“ReportGenerator”或类似的类,但不需要显示实际的报告。考虑一下如何绘制包含 30-50 个报告的系统图。
报告实际上更像是用例,只有当您准备好深入了解细节时才可以。它们属于界面讨论的一部分,就像设计 UI 或网页一样。
Reports are output from some other class and usually don't have behaviour of their own, hence they are typically not represented in a UML diagram. You might have a 'ReportGenerator' or somesuch class, but the actual reports do not need to be shown. Think about how you would diagram a system with 30-50 reports.
Reports are actually more like Use Cases, and then only if you are ready to get down into the details. They belong as part of the interface discussion, much like designing a UI or web page.