经过大量阅读后,我对课堂图表非常有信心。 但我不明白以下几点:
ChessManSet-<>----------16-ChessMan为什么没有0..16? 玩家可以放松他的西洋棋棋子。 这是在我公司一位受人尊敬的设计师所做的模型中展示的,当我问到这一点时,他只说“他们仍然属于他”。 所以我有点困惑,我希望这可以作为一个列表实现,显然可以从16减少到0。
After reading a lot, I was quite confident when it came to class diagrams. Yet I do not understand the following:
ChessManSet-<>----------16-ChessManWhy is there not 0..16? Player can loose his chessman. This was displayed in a model done by a respected designer in my company and when I asked about that, he said only "they still belong to him". So I'm a bit confused, I would expect that to be implemented as a list which obviously could decrease in its size from 16 to 0.
最满意答案
唯一可靠的是,根据您在实现中的模型或设计,您将始终拥有16个西洋棋棋子实例。 当然你可以选择实现一个可以从16减少到0的列表,但正如你所说,你必须将基数从16..16改为0..16。
The only sure thing is that according to your model or design in the implementation you will always have 16 chessman instances. Of course you can choose to implement a list which could decrease from 16 to 0 but, as you said, you have to change the cardinality from 16..16 to 0..16.
更多推荐
发布评论