1

I have a parent use case. I don't want to let the user use the parent use case. I only want the user to have access to child use cases. Think of it as an abstract class in Java. You can never instantiate an abstract class. Do use case diagrams allow such behavior?

Javier
  • 12,100
  • 5
  • 46
  • 57
FirstName LastName
  • 639
  • 2
  • 8
  • 21

4 Answers4

1

Yes, there can be "parent" or "child" use-cases. The connector that is used to model this relationship is called a generalization. See here: Use case generalization versus extension An example including diagrams is also given there.

Please note: If you model a generalization to a use case, then that's something else (!) than to <<extend>> one.

You can add remarks on invocation constraints in your textual use case description.

Community
  • 1
  • 1
observer
  • 2,925
  • 1
  • 19
  • 38
1

@observer's answer is almost perfect (i've +1'd it :)), except that he does not fully answers your question.

What you might do in your case is as follows:

enter image description here

  • Actor0 will manage to Pay bill, either with Pay with credit card or Pay with PayPal.
  • In the other hand, Actor1 will only be able to Pay with credit card.

Which means:

  1. Use generalisation to model the relationshipt between your "parent" use case and its "children".
  2. Let the actor that you want to "access" only one child, to be associated to only THAT Use Case.
gustavogbc
  • 695
  • 11
  • 33
-2

Yes! (and final too, since UseCase is a specialization of Classifier).

Quoting the Unified Modeling Language (OMG UML),Superstructure:

Generalizations

  • UseCase (from UseCases) specializes BehavioredClassifier (from BasicBehaviors, Communications).

  • BehavioredClassifier specializes Classifier (from Kernel, Dependencies, PowerTypes, Interfaces).

Attributes: Classifier has the following attributes:

  • isAbstract: Boolean (if true, the Classifier does not provide a complete declaration and can typically not be instantiated).

  • isFinalSpecialization: Boolean (if true, the Classifier cannot be specialized by generalization).

Constraints: a classifier may only specialize classifiers of a valid type.

   self.parents()->forAll(c | self.maySpecializeType(c))

Additional operations

The query maySpecializeType() determines whether this classifier may have a generalization relationship to classifiers of the specified type. By default a classifier may specialize classifiers of the same or a more general type.

Classifier::maySpecializeType(c : Classifier) : Boolean;
maySpecializeType = self.oclIsKindOf(c.oclType)

And last, but not least, even though it says that maySpecializeType() "is intended to be redefined by classifiers that have different specialization constraints"... there is no redefinition of maySpecializeType() for UseCase or BehavioredClassifier.

Source: Unified Modeling Language (OMG UML),Superstructure, Version 2.4.1.

Javier
  • 12,100
  • 5
  • 46
  • 57
  • 2
    Please expand on your answer; do you have a source/reference, or some specific guidance on how to do what the asker wants? – kwah Feb 21 '13 at 15:34
  • It's clear that you don't know the semanthics of the use case diagram elements or either you didn't understand his question. @observer has a better answer. – gustavogbc Jun 14 '13 at 19:37
-2

Your terminology is a bit off but in general the answer is yes.

There is no such term as "parent" or "child" use-case. Normally a use-case is a behavior triggered by user. What you seem to be needing is described by the include relationship between a base and included use-case. It's used to extract the common functional blocks to be reused by different use-cases. For example: Use-case include relationship example

See some more info here: What's is the difference between include and extend in use case diagram?

Community
  • 1
  • 1
SomeWittyUsername
  • 18,025
  • 3
  • 42
  • 85