-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use case with actors and system boundaries
- Loading branch information
Showing
8 changed files
with
322 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Use case tests</title> | ||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" /> | ||
<style> | ||
body { | ||
font-family: 'Roboto', sans-serif; | ||
padding: 20px; | ||
} | ||
hr { | ||
color: black; | ||
} | ||
div.mermaid { | ||
/* font-family: 'trebuchet ms', verdana, arial; */ | ||
font-family: 'Courier New', Courier, monospace !important; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h2>Basic Use Case</h2> | ||
<pre class="mermaid"> | ||
usecase-beta | ||
User -> (Open Bank Account) | ||
User --> (Get Loan) | ||
(Get Loan) --> (Credit Check) | ||
</pre> | ||
<hr /> | ||
|
||
<h2>Use Case with Title and Aliases</h2> | ||
<pre class="mermaid"> | ||
usecase-beta | ||
title Simple use case | ||
systemboundary | ||
title Acme System | ||
(Start) | ||
(Use) as (Use the application) | ||
(Another use case) | ||
end | ||
User -> (Start) | ||
User --> (Use) | ||
(Use) --> (Another use case) | ||
</pre> | ||
<hr /> | ||
|
||
<h2>Complex Use Case</h2> | ||
<pre class="mermaid"> | ||
usecase-beta | ||
title Student Management System Use Cases | ||
|
||
actor Student | ||
actor Admin | ||
service Authentication | ||
service Grades | ||
service Courses | ||
|
||
systemboundary | ||
title Student Management System | ||
(Login) { | ||
- Authenticate | ||
} | ||
(Submit Assignment) { | ||
- Upload Assignment | ||
} | ||
(View Grades) | ||
(Manage Users) { | ||
- Add User | ||
- Edit User | ||
- Delete User | ||
} | ||
(Manage Courses) { | ||
- Add Course | ||
- Edit Course | ||
- Delete Course | ||
} | ||
(Generate Reports) { | ||
- Generate User Report | ||
- Generate Course Report | ||
} | ||
(View Grades) { | ||
- View User Grades | ||
- View Course Grades | ||
} | ||
end | ||
|
||
Student -> (Login) -> Authentication | ||
Student -> (Submit Assignment) -> Courses | ||
Student -> (View Grades) -> Grades | ||
Admin -> (Login) -> Authentication | ||
Admin -> (Manage Users) -> Courses | ||
Admin -> (Manage Courses) -> Courses | ||
Admin -> (Generate Reports) -> Courses, Grades | ||
Admin -> (View Grades) -> Grades | ||
</pre> | ||
<script type="module"> | ||
import mermaid from './mermaid.esm.mjs'; | ||
mermaid.initialize({ | ||
theme: 'forest', | ||
logLevel: 3, | ||
securityLevel: 'loose', | ||
flowchart: { curve: 'basis' }, | ||
}); | ||
</script> | ||
<script> | ||
function testClick(nodeId) { | ||
console.log('clicked', nodeId); | ||
let originalBgColor = document.querySelector('body').style.backgroundColor; | ||
document.querySelector('body').style.backgroundColor = 'yellow'; | ||
setTimeout(function () { | ||
document.querySelector('body').style.backgroundColor = originalBgColor; | ||
}, 100); | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export interface UsecaseStyleOptions { | ||
clusterBkg: string; | ||
clusterBorder: string; | ||
lineColor: string; | ||
mainBkg: string; | ||
} | ||
|
||
const getStyles = (options: UsecaseStyleOptions) => | ||
` | ||
.actor { | ||
stroke: ${options.lineColor}; | ||
background: white; | ||
} | ||
.node { | ||
fill: ${options.mainBkg}; | ||
} | ||
.cluster rect { | ||
fill: ${options.clusterBkg}; | ||
stroke: ${options.clusterBorder}; | ||
stroke-width: 1px; | ||
} | ||
.flowchart-link { | ||
stroke: ${options.lineColor}; | ||
fill: none; | ||
} | ||
`; | ||
|
||
export default getStyles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.