问题描述
我想将附加的UML转换为伪代码。我在下面有以下类和接口头。
我想知道
I would like to translate the attached UML to Pseudocode. I have the following class and interface headers below.I would like to know
1)如果这是正确的?
1) if this is correct?
2)什么是Store和Manager以及Store和StoreEmployee之间的关系?
我将Manager和StoreEmployee作为Store中的私有字段。它是否正确?
如果是,那么为什么它们不包含在属性中
2) what is the relation between Store and Manager and Store and StoreEmployee?I have Manager and StoreEmployee as private fields in Store. Is this correct?if yes, then why they are not included in attributes
3)商店和商店测试之间的关系是什么?
3)What is the relation between store and Store Test ?
4)我有Employee作为接口而PayRoll Record作为具体类?
这是对的吗?两者都有断线箭头连接?
4) I have Employee as interface while PayRoll Record as concrete class?Is this correct? both have broken line arrow connection?
public interface Employee { }
public class Manager implements Employee{ }
public class StoreEmployee implements Employee{ }
public class SalesAssociate extends StoreEmployee { }
public class PayrollRecord { } //
public class Store extends PayrollRecord { } // does it have Manager and StoreEmployee as private fields
public class StoreTest { } //does it have Store as private field
推荐答案
以下是一些不能完美解决问题的快速解答,同时仍然希望指出你正确的方向。
Here are some quick answers that don't fulfil your questions perfectly, while still hopefully point you in the right direction.
- 你的扩展与你的组合混合了。再次检查您的UML文档。所以,不,你不正确..但在某些地方也是正确的。 :)
- 商店有一个经理(如果没有附加数字,则假定它是1..1关系)。
- 看看你在以前的解决方案中如何使用相同的箭头。
- 是的,看看箭头。
员工
意味着继承,其中PayRollRecord
只是一般用法箭头。
- You have your extends mixed in with your composed of. Check your UML documentation again. So, no you are incorrect.. but also correct in some places. :)
- A Store has a single manager (if there is not a number attached, then it is assumed to be a 1..1 relationship).
- Look at how you used the same arrow in previous solutions.
- Yes, look at the heads of the arrows. The
Employee
implies inherits from, where thePayRollRecord
is just a general usage arrow.
对于这些,以前的答案应该可以帮助您在这里回答您的问题。 :)
For these, the previous answers should help you answer your questions here. :)
public class Store extends PayrollRecord { } // does it have Manager and StoreEmployee as private fields
public class StoreTest { } //does it have Store as private field
这篇关于Java Pseudocode中附加UML图的解释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!