Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // exercise 1
- sequenceDiagram
- autonumber
- actor U as User
- participant WS as Web Server
- participant SD as Salt Database
- participant PD as Password Database
- U->>WS: Access Web Server
- WS->>U: Promt for Username
- U->>WS: Provide Username
- WS->>U: Prompt for Password
- U->>WS: Provide Password
- WS->>SD: Send Username
- SD->>SD: Search for Salt
- SD-->>WS: Return Salt
- WS->>WS: Encrypt provided password using Salt
- WS->>PD: Send Username
- PD->>PD: Search for stored Encrypted Password
- PD-->>WS: Return stored Encrypted Password
- WS->>WS: Compare Encrypted Passwords
- alt Passwords Match
- WS->>U: Display Success Page
- else Passwords Do Not Match
- WS->>U: Display Failure
- end
- stateDiagram-v2
- [*] --> Idle
- note right of Idle : Waiting for requests
- Idle --> Searching : Recieve Username
- note right of Searching: Database looks up record
- Searching --> Replying : Salt Found
- note right of Replying: Sending data back
- Replying --> Idle : Salt Sent
- // exercise 2
- stateDiagram-v2
- [*] --> Idle: Power On
- state "Idle\n(entry: LED Off)\n(do: Display Time)" as Idle
- state "Alarm Setting" as Setting
- state "Alarming\n(entry: Start Flash)\n(do: Beep)" as Alarming
- state "Snooze\n(do: Display Time)" as Snooze
- Idle --> Setting: press set button
- Setting --> Idle: press save button
- Idle --> Alarming: alarm time reached / Turn LED On
- Alarming --> Idle: press stop button / Stop Beeping, Stop Flashing
- Alarming --> Snooze : press snooze button / Stop Flashing
- Snooze --> Alarming: after 5 mins / Send E-mail
- // exercise 3
- graph TD
- Mobile[Mobile Device]
- Web[Web Browser]
- subgraph "E-Store Application"
- Acc[Accounting Function]
- Cat[Catalogue Function]
- Ord[Ordering Function]
- Pri[Pricing Function]
- Inv[Inventory Function]
- end
- DB_Acc[(Accounting DB)]
- DB_Cat[(Catalogue DB)]
- DB_Ord[(Ordering DB)]
- DB_Pri[(Pricing DB)]
- DB_Inv[(Inventory DB)]
- Mobile -.-> Acc
- Mobile -.-> Cat
- Mobile -.-> Ord
- Web -.-> Acc
- Web -.-> Cat
- Web -.-> Ord
- Ord --> |Output is Input| Pri
- Pri --> |Output is Input| Inv
- Acc --- DB_Acc
- Cat --- DB_Cat
- Ord --- DB_Ord
- Pri --- DB_Pri
- Inv --- DB_Inv
Advertisement
Add Comment
Please, Sign In to add comment