如何验证给定域的类图?
我正在研究汽车经销商业务域模型/UML 类图。
我是建模新手,所以我想知道如何验证类图。 对于我来说,拥有一个适当的(即使不是 100% 正确的)类图来使用进一步的开发(用例等)非常重要。
有可能建立一个完全错误的模型吗? 或者只有合适和不太合适的模型?
如果我有一个与 SalesTeam 关联的客户,对 SalesTeam 所服务的客户进行建模,这是错误的吗? 我在示例中看到过 Customer 与 Order 关联、Order 与 ItemOrder 关联以及 ItemOrder 与 ItemInventory 关联。 其中销售团队或员工与订单关联。
如何验证我的模型和关系?
I am working on car dealership business domain model/UML class diagram.
I am new to modeling, so I would like to know how to validate the class diagram. It's very important for me to have an appropriate, if not 100 percent correct, class diagram to use further development (use cases, etc.).
Is it possible to build a completely incorrect model? Or are there only appropriate and less appropriate models?
If I have a Customer associated with SalesTeam modeling a customer being served by SalesTeam, is that wrong? I have seen in examples of Customer being associated with Order, Order with ItemOrder and ItemOrder with ItemInventory. Where the SalesTeam or Staff is associated with Order.
How do I validate my model and relationships?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要验证域模型,请执行以下操作。
编写用例。 在写作过程中,确保以一致的方式使用名词和动词。 为了确保您的名词有意义,请务必在域模型中记录注释。
按照您的域模型演练每个用例。 那里的实体? 导航所需的关系? 每个实体的属性?
由于它是一个领域模型,请尽量避免将事物描述为类——它们通常是现实世界的实体。
例如,您将从用例中了解到“与销售团队实体有直接关系的客户实体”。 例如,客户与订单相关联,但订单是由销售团队创建的。 因此,客户和订单之间有两条导航路径:直接导航和通过销售团队。 (在我看来)两者都是正确的。
您必须将领域模型与用例进行比较,以确保两者一致。
To validate domain models, do the following.
Write use cases. During the writing, make sure you're using nouns and verbs in a consistent way. To be sure that your nouns make sense, be sure to record notes in the domain model.
Walk through each use case, following along on your domain model. At the entities there? Relationships required for navigation? Attributes of each entity?
Since it's a domain model, try to avoid describing things as classes -- they're usually real-world entities.
For example "customer entity in direct relationship with sales team entity" is something you'll learn from the use cases. For example, customers are associated with orders, but the order is created by the sales team. So, you have two navigation paths between customer and order: direct and via the sales team. Both appear (to me) to be true.
You must compare your domain model with your use cases to be sure both agree.
简短的回答是,这并不是很重要。
使用域类图记录您认为域中的内容,仅此而已。 它不是你的神,随你去改变它不会伤害你。
The short answer is that this is not very important.
Use your domain class diagrams to keep a note of what you think is in the domain, that is all. It is not your god, and it will not hurt you to change it as you go.
领域专家应该帮助您验证领域模型。
至于验证特定关系,当您进一步开发模型并研究对象之间的协作时,您将发现更多不同的关系。 在分析和开发过程中,您需要经常重新访问领域模型。
我认为它预先“正确”(即在您继续查看用例和进一步分析之前)并不重要,重要的是它有用 - 它为您提供了问题的概念模型以及所涉及的主要类是。 直到软件不再被开发或维护为止,它才算完成。
如果它代表了您现在看待问题的方式,那么您就足以开始进一步分析。 随着您对问题的看法发生变化并了解更多信息,请对其进行修改。
Domain experts should help you to validate the domain model.
As far as validating the specific relationships, as you develop the model further and investigate the collaborations between objects you will discover more and different relationships. You will need to revisit the domain model often during your analysis and development.
I don't think it matters that it's 'correct' up front (i.e. before you move onto looking at use cases and further analysis), only that it is useful - it gives you a conceptual model of the problem and what the main classes involved are. It isn't going to be finished until the software is no longer being developed or maintained.
If it represents the way you view the problem right now, it's good enough for you to start further analysis. Revise it as your view of the problem changes and you learn more.