开发者

How to model in UML this specific scenario

I have to model some specs, and I can't understand what kind of uml diagram I should be using.

This is the scenario: There are 3 nested categories called area, grouping and topic. Under the topic, there are possible "activation codes" which will define a serie of document. Let me clarify with an example:

Area A1, Grouping G1, Topic T1.

  • If there is activation code "X1" then documents Y1 and Y2 are present.
  • If there is "X5" in con开发者_开发百科junction of "X1" then documents Y3 and Y4 are also present.
  • If there is "X2" then Y5 is present
  • If there is "X5" in conjunction of "X2" then Y3 and Y4 are also present.

etc.

How these activation codes are "activated" is outside the scope of this diagram. This diagram must only represent what documents will be present in various scenarios of activation codes.

Any kind of help is appreciated. Thanks.


I would say that this behavior is too fine-grained to be in an UML spec. Do a basic class diagram with Topic "has many" Documents, then write the rules as plain English in an accompanying notice.

My answer might not be what you expect as I know some people like to specify the smallest details of their apps in complex UML diagrams. From my experience, it rarely makes the specs any better...


Solendil makes a good point.

However this could be a number of different UML diagrams. On a sequence diagram, with each activation code offering an alternative path with guard conditions as you see fit.

It could alternatively and I think probably more sensibly be a state diagram. With the state inputs becoming your activation codes and the 'states' are the documents to output. This might be better displayed in a truth table rather than a diagram though. Or used in conjunction. I like to have a few different representations for this kind of strict behavior. One so it's easy to map in my own head, but also different people find it easier to read information in different ways. Or whichever works best for whoever you are trying to communicate the info to!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜