Skip to content

Improve singleton code doc#3453

Open
MADHURI-HS wants to merge 3 commits intoiluwatar:masterfrom
MADHURI-HS:improve-singleton-code-doc
Open

Improve singleton code doc#3453
MADHURI-HS wants to merge 3 commits intoiluwatar:masterfrom
MADHURI-HS:improve-singleton-code-doc

Conversation

@MADHURI-HS
Copy link

Added JavaDoc comments to improve clarity of the Singleton implementation.

This change enhances code readability by explaining the purpose of the getInstance() method and how it ensures a single instance throughout the application.

@github-actions
Copy link

github-actions bot commented Mar 24, 2026

PR Summary

Adds JavaDoc for singleton instance method; updates READMEs to reflect usage notes (event-driven observer implications and database connection example); clarifies IvoryTower singleton behavior with explicit getInstance() documentation.

Changes

File Summary
observer/README.md Added a new bullet noting that the Observer pattern is especially useful in event-driven systems where a change in one object should automatically reflect in multiple dependents.
singleton/README.md Added a bullet indicating that database connection management systems can benefit from a singleton to ensure a single shared instance across the application.
singleton/src/main/java/com/iluwatar/singleton/IvoryTower.java Enhanced class Javadoc to state the eagerly initialized, thread-safe singleton nature and added getInstance() documentation describing the single instance contract.

autogenerated by presubmit.ai

Copy link

@github-actions github-actions bot left a comment

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 (3)
  • dce1b3c: Added JavaDoc for singleton instance method
  • f2d8546: Improved observer pattern documentation with use case explaination
  • d2a8516: Added database connection example to Singleton pattern
Files Processed (3)
  • observer/README.md (1 hunk)
  • singleton/README.md (1 hunk)
  • singleton/src/main/java/com/iluwatar/singleton/IvoryTower.java (2 hunks)
Actionable Comments (0)
Skipped Comments (4)
  • observer/README.md [177-177]

    readability: "Add usage context for Observer pattern"

  • singleton/README.md [81-81]

    readability: "Improve README bullet for database singleton example"

  • singleton/src/main/java/com/iluwatar/singleton/IvoryTower.java [27-31]

    readability: "Document singleton class contract"

  • singleton/src/main/java/com/iluwatar/singleton/IvoryTower.java [50-56]

    readability: "Improve Javadoc for getInstance()"

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