Skip to content

Update diagram colors and clarify design pattern documentation#28

Merged
RISHIK92 merged 4 commits into
RISHIK92:mainfrom
mrstrange1708:main
Apr 13, 2026
Merged

Update diagram colors and clarify design pattern documentation#28
RISHIK92 merged 4 commits into
RISHIK92:mainfrom
mrstrange1708:main

Conversation

@mrstrange1708
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 13, 2026 09:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates documentation/diagrams to better distinguish Strategy vs Factory in the codebase, and adjusts Mermaid styling for the use case diagram.

Changes:

  • Clarifies Strategy Pattern documentation with explicit runtime-selection framing and a Strategy vs Factory comparison.
  • Expands Factory Pattern documentation with object-construction examples and a side-by-side table.
  • Updates Mermaid use case diagram stroke colors to black for improved visual consistency.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
diagrams/07_design_patterns.md Refines Strategy/Factory explanations and adds illustrative examples/comparisons.
diagrams/04_use_case_diagram.md Updates Mermaid node stroke colors to #000000.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +302 to +309
registry := NewDefaultRegistry() // Factory builds the registry
runner := &DefaultRunner{} // Factory builds the runner
storage := &LocalTempStorageAdapter{BaseDir: "/dev/shm"} // Factory builds storage
svc := NewSubmissionService(runner, registry, storage) // Factory wires everything

// Later at runtime — Strategy selects the algorithm:
strategy, _ := svc.registry.Get("python") // ← This is Strategy, not Factory
strategy.Prepare(ws, sourceCode) // ← Strategy executes
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example uses &LocalTempStorageAdapter{BaseDir: "/dev/shm"}, but LocalTempStorageAdapter is defined as an empty struct (see backend/processSubmission/local_storage_adapter.go) and has no BaseDir field. As written, this snippet won’t compile and also contradicts the current implementation which always uses os.TempDir(). Update the example to match real construction (e.g., &LocalTempStorageAdapter{}) or change the adapter to support configuring a base dir if that’s the intent.

Suggested change
registry := NewDefaultRegistry() // Factory builds the registry
runner := &DefaultRunner{} // Factory builds the runner
storage := &LocalTempStorageAdapter{BaseDir: "/dev/shm"} // Factory builds storage
svc := NewSubmissionService(runner, registry, storage) // Factory wires everything
// Later at runtime — Strategy selects the algorithm:
strategy, _ := svc.registry.Get("python") // ← This is Strategy, not Factory
strategy.Prepare(ws, sourceCode) // ← Strategy executes
registry := NewDefaultRegistry() // Factory builds the registry
runner := &DefaultRunner{} // Factory builds the runner
storage := &LocalTempStorageAdapter{} // Factory builds storage
svc := NewSubmissionService(runner, registry, storage) // Factory wires everything
// Later at runtime — Strategy selects the algorithm:
strategy, _ := svc.registry.Get("python") // ← This is Strategy, not Factory
strategy.Prepare(ws, sourceCode) // ← Strategy executes

Copilot uses AI. Check for mistakes.
@RISHIK92 RISHIK92 merged commit bafd818 into RISHIK92:main Apr 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants