"<p data-start="163" data-end="387">UML (Unified Modeling Language) use case diagrams are a great way to visualize how users (or "actors") interact with a system. They help us map out system functionalities and show how different actors engage with the system.</p> <p data-start="389" data-end="535">In this guide, we'll break down the core components of a use case diagram and explain how they work using the <strong data-start="499" data-end="520">DevBrains website</strong> as an example.</p> <p data-start="389" data-end="535"> </p> <h4 data-start="389" data-end="535">1. Primary Actors: Who Interacts with the System</h4> <p> </p> <p data-start="596" data-end="757">Primary actors are the users or external systems that interact with the system to achieve a goal. In a use case diagram, these actors are shown as stick figures.</p> <p data-start="759" data-end="789">For example, on <strong data-start="775" data-end="788">DevBrains</strong>:</p> <ul data-start="790" data-end="928"> <li data-start="790" data-end="833"><strong data-start="792" data-end="803">Visitor</strong>: Can browse and view content like tutorials and blogs.</li> <li data-start="834" data-end="878"><strong data-start="836" data-end="846">Editor</strong>: Can edit and publish articles.</li> <li data-start="879" data-end="928"><strong data-start="881" data-end="890">Admin</strong>: Manages users and moderates content.</li> </ul> <p data-start="930" data-end="1010">Each actor interacts with the system in different ways, depending on their role.</p> <p data-start="930" data-end="1010"> </p> <h4 data-start="1012" data-end="1055">2. Use Cases: What the System Does</h4> <p> </p> <p data-start="1057" data-end="1203">Use cases represent the specific actions or goals the system performs when an actor interacts with it. These are shown as ellipses in the diagram.</p> <p data-start="1205" data-end="1217">For example:</p> <ul data-start="1218" data-end="1358"> <li data-start="1218" data-end="1254"><strong data-start="1220" data-end="1229">Authentication</strong>: Allows users to log in.</li> <li data-start="1255" data-end="1309"><strong data-start="1257" data-end="1273">Manage Article</strong>: Enables Editors to manage blogs.</li> <li data-start="1310" data-end="1358"><strong data-start="1312" data-end="1328">View Tutorials</strong>: Lets Visitors view tutorials.</li> </ul> <p data-start="1360" data-end="1431">Use cases are what the system offers in response to an actor’s request.</p> <p data-start="1360" data-end="1431"> </p> <h4 data-start="1433" data-end="1492">3. Relationships: How Actors and Use Cases Connect</h4> <p> </p> <p data-start="1494" data-end="1593">There are a few key relationships in use case diagrams that show how actors and use cases interact:</p> <ul data-start="1595" data-end="2388"> <li data-start="1595" data-end="1757"> <p data-start="1597" data-end="1757"><strong data-start="1597" data-end="1612">Association</strong>: The basic relationship where an actor is connected to a use case. For instance, a <strong data-start="1696" data-end="1707">Visitor</strong> is associated with the <strong data-start="1731" data-end="1747">View Blogs </strong>use case.</p> </li> <li data-start="1761" data-end="1938"> <p data-start="1763" data-end="1938"><strong data-start="1763" data-end="1774">Include</strong>: This means a use case always includes another. For example, <strong>Manage Profile </strong>might include an <strong data-start="1863" data-end="1879">Authentication</strong> use case to ensure users are validated before they edit their profile.</p> </li> <li data-start="1940" data-end="2115"> <p data-start="1942" data-end="2115"><strong data-start="1942" data-end="1952">Extend</strong>: This shows optional behavior. For instance, a <strong>Take challenge</strong> use case can extend the <strong>View tutorials </strong>use case, adding the option to take challenge while/after watching a tutorial.</p> </li> <li data-start="2117" data-end="2388"> <p data-start="2119" data-end="2388"><strong data-start="2119" data-end="2137">Generalization</strong>: This represents a specialized version of a use case or actor. For example, different <strong data-start="2224" data-end="2250">authentication methods</strong> (like <strong data-start="2257" data-end="2287">OAuth with Google/Facebook</strong>, <strong data-start="2289" data-end="2306">Basic Sign-In</strong>, or <strong data-start="2311" data-end="2326">Remember Me</strong>) can be generalized under a single <strong data-start="2362" data-end="2378">Authentication </strong>use case.</p> </li> </ul> <p> </p> <h4 data-start="2390" data-end="2448">4. Secondary Actors: External Systems or Services</h4> <p> </p> <p data-start="2450" data-end="2620">Secondary actors are external systems or services that the system relies on to complete a use case. They don’t directly initiate the action but provide necessary support.</p> <p data-start="2622" data-end="2634">For example:</p> <ul data-start="2635" data-end="2768"> <li data-start="2635" data-end="2768"><strong data-start="2637" data-end="2656">Google/Facebook</strong>: These external services could be secondary actors in the <strong data-start="2362" data-end="2378">Authentication</strong> use case, helping authenticate users.</li> </ul>"