3

If I have two use cases: Send Email, and View Contact Page. And Send Email includes View Contact Page. Do I still need to use association to connect my actor(user) with Send Email if I want to show that he can send emails? Or It is enough to connect actor with View Contact Page with association?

enter image description here

Here how it looks like. What I mean: is that association with send email is necessary?

3

Martin Fowler says in UML Distilled:

Use include when you are repeating yourself in two or more separate use cases and you want to avoid repetition.

View Contact and View Documentation don't appear to be used more than once, so this isn't really a good use of include according to this advice.

The answer is probably in the text of your use cases. If the only way to View a Contact is through the Send email use-case, then by virtue of it only being used once, you just make it part of (an alternative flow of) the Send email use-case, without a separate Use Case name.

On the other hand, if it's possible to View a Contact outside of the Send email use case and the steps are identical (and thus you don't want to repeat yourself), then using include is OK.

As for extend, the advice from Fowler is (emphasis mine):

The UML includes other relationships between use cases beyond the simple includes, such as «extend». I strongly suggest that you ignore them. I've seen too many situations in which teams can get terribly hung up on when to use different use case relationships, and such energy is wasted. Instead, concentrate on the textual description of a use case; that's where the real value of the technique lies.

The advice speaks for itself.

1

In your current model, Send Email includes View Contact Page. That means that all of the steps in the View Contact Page are included in the Send Email use case. If you actor can execute both the View Contact Page and Send Email use cases, then the actor needs to be explicitly linked to both.

However, there's likely a more natural representation of this. I think that Send Email is actually an extension of View Contact Page. In this case, you can say that Send Email is an extra (perhaps optional) set of steps that happens after someone executes View Contact Page. In this case, you no longer need to link the actor to the Send Email use case.

  • 1
    It would be good to note that this answer assumes that "Send Email" in included in "View Contact Page", which means that the arrow in the diagram should point from "View Contact Page" to "Send Email". – Bart van Ingen Schenau Jun 21 '17 at 13:41
  • @BartvanIngenSchenau Valid point - the text of the question and the image (which was not there when I posted this answer, or at least I didn't see it) don't agree. The arrow in the image does appear to be backwards. – Thomas Owens Jun 21 '17 at 13:43
  • Sorry for that. So only by looking at the image right now. Is it necessary to connect actor with Send email in this case? – motleycrue Jun 21 '17 at 13:45
  • 1
    @motleycrue: With the current image, the association to "Send Email" is required, but the association from the actor to "View Contact Page" is only needed if that use-case can be triggered without going through the "Send Email" use-case. – Bart van Ingen Schenau Jun 21 '17 at 13:47
  • @ThomasOwens: Actually, the text of the question agrees with the image, but to me it would also have been more natural if the inclusion was the other way around. – Bart van Ingen Schenau Jun 21 '17 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.