UML 中的排他性弧是什么
以下是排他性弧线(绿色弧线)的示例;它的意思是飞机可以配备螺旋桨或喷气发动机,但不能同时配备两者。
在 Barker ER 表示法中,排除 对两个或多个角色的约束是 显示为连接的“独占弧” 到带有小点的角色或 圆圈。
- 请参阅http://www.orm.net/pdf/JCM12.pdf(页面2)。
顺便问一下 - 你能把它们放在 DDD 中吗? (我假设你可以,如果它们是 UML 的一部分)。
编辑 - 我关于 DDD 的问题有点误导,我把它放在事后的想法中,但 @sfinnies 的回答提出了另一个有效的问题,我将单独提出这个问题(经过一些研究)。
Here's an example of what an Exclusivity Arc is (the green arc); what it's saying is that a Plane can have either Propellers or Jet Engines - but not both.
In Barker ER notation, an exclusion
constraint over two or more roles is
shown as an “exclusive arc” connected
to the roles with a small dot or
circle.
- see http://www.orm.net/pdf/JCM12.pdf (page 2).
By the way - can you have them in DDD? (I'm assuming you can if they're part of UML).
Edit - my question around DDD isa bit misleading and I put it inas an after-thought, but @sfinnies answer raises another valid question which I'll ask separately (after some research).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定“由 DDD 支持”是什么意思?
DDD 本身不提供建模语言:它是方法(如何解决问题)和架构(如何构建应用程序)的组合。
您正在表达一条业务规则:飞机可以配备喷气发动机或螺旋桨发动机,但不能同时配备两者。
这是来自域的有效约束,大概它与您的应用程序相关,因此需要在域逻辑中捕获它。所以从这个角度来看,是的,它是由 DDD 支持的。
如何实现它部分取决于您的语言选择,但我猜测 Plane 将是聚合根,因此负责确保满足约束。 DDD 所说的是,作为域约束,它应该在域逻辑中捕获:而不是其他架构层。
哈
Not sure what you mean by "supported by DDD"?
DDD doesn't provide a modelling language itself: it's a combination of method (how to attack the problem) and architecture (how to structure your application).
You're expressing a business rule: a plane can have either jet engines or propeller engines but not both.
That's a valid constraint from the Domain, presumably it's relevant to your application, and therefore it needs to be captured in the domain logic. So from that perspective yes, it is supported by DDD.
How you implement it will depend partly on your language choice, but I'd make a guess that Plane will be an Aggregate root and so be responsible for ensuring the constraint is met. What DDD says is that, as a Domain constraint, it should be captured in your domain logic: not some other architectural layer.
hth