Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ohmycloud/design-pattern-in-rust
https://github.com/ohmycloud/design-pattern-in-rust
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ohmycloud/design-pattern-in-rust
- Owner: ohmycloud
- Created: 2024-11-05T02:56:47.000Z (11 days ago)
- Default Branch: master
- Last Pushed: 2024-11-05T11:01:53.000Z (11 days ago)
- Last Synced: 2024-11-05T12:34:42.762Z (11 days ago)
- Language: Rust
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Design Patterns in Rust
https://siddharthqs.com/design-patterns-in-rust
## Strategy pattern Class Diagram
```markdown
+-----------------------------------------------------------------+
| <> |
| ExecutionStrategy |
|-----------------------------------------------------------------|
| + execute_order(...) |
+-----------------------------------------------------------------+/|\ /|\ /|\
| | |
| | |
+---------------+ +--------------+ +--------------+
| TwapStrategy | | VwapStrategy | | PovStrategy |
|---------------| |--------------| |--------------|
| | | | | - participation_rate: f64 |
|---------------| |--------------| |--------------|
| + execute_order(...)|+ execute_order(...) |+ execute_order(...)|
+---------------+ +--------------+ +--------------++-----------------------------+
| OrderExecutor |
|-----------------------------|
| - strategy: ExecutionStrategy |
|-----------------------------|
| + new(strategy) |
| + set_strategy(strategy) |
| + execute(order_id, quantity) |
+-----------------------------+```