Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ohmycloud/design-pattern-in-rust


https://github.com/ohmycloud/design-pattern-in-rust

Last synced: 2 days ago
JSON representation

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) |
+-----------------------------+

```