Skip to content

Docs/singleton comparison#3529

Open
shabinfrancis wants to merge 2 commits into
iluwatar:masterfrom
shabinfrancis:docs/singleton-comparison
Open

Docs/singleton comparison#3529
shabinfrancis wants to merge 2 commits into
iluwatar:masterfrom
shabinfrancis:docs/singleton-comparison

Conversation

@shabinfrancis

Copy link
Copy Markdown

What does this PR do?

Adds a comparison table to the Singleton pattern documentation to help readers understand the differences between Eager Initialization and Thread-Safe Lazy Initialization implementations.

Changes

  • Added a comparison table for Singleton implementations.
  • Included key differences such as object creation, thread safety, synchronization requirements, memory usage, and performance considerations.
  • Improved readability for beginners learning the Singleton design pattern.

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

PR Summary

Added a comparison table in the Singleton README contrasting Eager Initialization and Thread-Safe Lazy Initialization, highlighting object creation timing, thread safety, synchronization, memory usage, performance, and complexity. Also added a notification service example to the Factory Method README to improve readability for beginners learning design patterns.

Changes

File Summary
factory-method/README.md Added a concise narrative demonstrating a Factory Method selecting a notification service (Email, SMS, or Push) to illustrate the pattern's instantiation logic.
singleton/README.md Introduced a new section 'Singleton Implementation Comparison' that contrasts Eager Initialization with Thread-Safe Lazy Initialization, detailing object creation timing, thread safety, synchronization needs, memory usage, and performance.

autogenerated by presubmit.ai

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (2)
  • 690b4b8: docs: add comparison table for singleton implementations
  • 47a97fb: Add notification service example to Factory Method README
Files Processed (2)
  • factory-method/README.md (1 hunk)
  • singleton/README.md (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
  • factory-method/README.md [34-36]

    readability: "Clarify Factory Method documentation example."

  • singleton/README.md [40-49]

    readability: "Add explanatory context to the singleton comparison table."

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@d4a0ece). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #3529   +/-   ##
=========================================
  Coverage          ?   83.25%           
  Complexity        ?     4028           
=========================================
  Files             ?     1060           
  Lines             ?    14246           
  Branches          ?      686           
=========================================
  Hits              ?    11860           
  Misses            ?     2102           
  Partials          ?      284           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant