Note that there are some explanatory texts on larger screens.

plurals
  1. POUse case generalization versus extension
    primarykey
    data
    text
    <p>UML Use Case Diagrams allow for two seemingly equivalent ways to show that a given use case might be realised in several different ways namely <a href="https://i.stack.imgur.com/VThNF.png">use case generalizations</a> as opposed to <a href="https://i.stack.imgur.com/Xc0hU.png">use case extensions</a>. I have seen the following basically example modelled using either approach with equal frequency, sometimes within a single source.</p> <p><img src="https://i.stack.imgur.com/VThNF.png" alt="Use case generalisation image"></p> <p><img src="https://i.stack.imgur.com/Xc0hU.png" alt="Use case extension image"></p> <p>To my mind an extension is a weaker relationship than generalization as a direct substitution of the specialised use case for the base case must be possible in generalization but not necessarily in extensions.</p> <p>It seems to me that generalisation implies a polymorphic implementation is desired while extension implies some branching structure is to be used. </p> <pre><code>void makePayment(const PaymentDetails* pd) { pd-&gt;pay(); } </code></pre> <p>as opposed to</p> <pre><code>void makePayment(const PaymentDetails* pd) { switch(pd-&gt;type) { case EFT: payViaEFT(pd); break; case PAYPAL: payViaPayPal(pd); break; case CREDITCARD: payViaCreditCard(pd); break; } } </code></pre> <p>Isn't the Use Case stage far too early for such implementation specific concerns to be modelled? There are much more appropriate UML diagrams for that. Is there a hard and fast rule regarding which of the two to use and if so what is it?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload