Skip to content

add monitor design pattern . #1640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Oct 16, 2021
Merged

add monitor design pattern . #1640

merged 30 commits into from
Oct 16, 2021

Conversation

Dev-AliGhasemi
Copy link
Contributor

Add Monitor design pattern

Monitor pattern is used to create thread-safe object . In the concurrent application to prevent conflict between threads .

Pull request description

add new design pattern as Monitor !

@ohbus ohbus self-assigned this Jan 30, 2021
Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

Thank you so much for taking out the time to contribute to this repository.

Add to parent pom module for building so that the CI can check.

Please be sure to check out the Wiki section as it can improve the quality of the Pull Request you have created.

@iluwatar
Copy link
Owner

@Dev-AliGhasemi probably this issue #466

@Dev-AliGhasemi
Copy link
Contributor Author

i added class diagram !

@Dev-AliGhasemi Dev-AliGhasemi requested a review from ohbus February 2, 2021 12:34
@ohbus
Copy link
Contributor

ohbus commented Feb 4, 2021

@Dev-AliGhasemi I am a tad busy this week, will check this out by the weekend.

Thanks

@ohbus
Copy link
Contributor

ohbus commented Feb 8, 2021

Thanks @iluwatar for the insight!

@Dev-AliGhasemi Please amend the changes requested by @iluwatar here in the review comment.

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

Have a look at the suggested changes.

@Dev-AliGhasemi
Copy link
Contributor Author

i deleted all mvnw files but still not work !

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

@Dev-AliGhasemi fixed the issue with mvnw

Now you can continue working with it

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Dev-AliGhasemi
Copy link
Contributor Author

why there is not monitor pattern in this list here ?

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

why there is not monitor pattern in this list here ?

I really did not understand the context here.

It would be great if you could explain a bit further so that we can clarify on our part.

Please mention us when this Pull Request is ready to review.

On your part you need to work on providing test cases and increase coverage of code with more than 80%

@Dev-AliGhasemi
Copy link
Contributor Author

is my design pattern ok ? and is it ready to publish ?

@ohbus
Copy link
Contributor

ohbus commented Mar 25, 2021

is my design pattern ok ? and is it ready to publish ?

Please take a look at my previous comment.

@ohbus ohbus linked an issue Apr 22, 2021 that may be closed by this pull request
@Dev-AliGhasemi
Copy link
Contributor Author

why there is not monitor pattern in this list here ?

I really did not understand the context here.

It would be great if you could explain a bit further so that we can clarify on our part.

Please mention us when this Pull Request is ready to review.

On your part you need to work on providing test cases and increase coverage of code with more than 80%

i have to write test cases to complete this pattern and publish it ?

@ohbus
Copy link
Contributor

ohbus commented Jun 7, 2021

why there is not monitor pattern in this list here ?

I really did not understand the context here.
It would be great if you could explain a bit further so that we can clarify on our part.
Please mention us when this Pull Request is ready to review.
On your part you need to work on providing test cases and increase coverage of code with more than 80%

i have to write test cases to complete this pattern and publish it ?

That is absolutely correct. Test Cases with 80% and above of coverage.

@Dev-AliGhasemi
Copy link
Contributor Author

@iluwatar
Unit tests with more 80% coverage added
Language "en" added to readme.md

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@iluwatar iluwatar added this to the 1.25.0 milestone Oct 16, 2021
@iluwatar iluwatar merged commit c2786e5 into iluwatar:master Oct 16, 2021
@iluwatar
Copy link
Owner

It was a long road, but we got there eventually. Thanks for putting the new pattern together!
@all-contributors please add @Dev-AliGhasemi for code

@allcontributors
Copy link
Contributor

@iluwatar

I've put up a pull request to add @Dev-AliGhasemi! 🎉

@Dev-AliGhasemi
Copy link
Contributor Author

Thank's @iluwatar

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

@iluwatar This pattern was never added to the parent POM the reason why SONAR was never generated.

I believe we should have checked for SONAR issues before merging this code.

Moreover the project is not getting built in the first place. I believe we should revert these two commits and take another round of look before merging this again to the master.

iluwatar added a commit that referenced this pull request Oct 19, 2021
@iluwatar
Copy link
Owner

@ohbus thanks for noticing it. I think we can address the thing with another issue and not have to revert the merge.

@iluwatar
Copy link
Owner

Added bug ticket #1871. @Dev-AliGhasemi would you like to try to fix it? If yes, please comment on the issue and we'll assign it to you.

RobbiNespu pushed a commit to RobbiNespu/java-design-patterns that referenced this pull request Mar 1, 2022
* add monitor design pattern .

* add extra line and change compiler version to 11 in pom.xml.

* encapsulate getBalance method .

* update puml file .

* export uml as png .

* duplicate codes eliminated .

* update tag

* change the format of pom.xml

* using logger to print

* change AtomicRefrence to type inference var

* explanations added !

* Update monitor/README.md

Co-authored-by: Ilkka Seppälä <[email protected]>

* Update monitor/README.md

Co-authored-by: Ilkka Seppälä <[email protected]>

* Update monitor/src/main/java/com/iluwatar/monitor/Main.java

Co-authored-by: Ilkka Seppälä <[email protected]>

* Update monitor/src/main/java/com/iluwatar/monitor/Main.java

Co-authored-by: Ilkka Seppälä <[email protected]>

* Update monitor/src/main/java/com/iluwatar/monitor/Main.java

Co-authored-by: Ilkka Seppälä <[email protected]>

* Update monitor/src/main/java/com/iluwatar/monitor/Main.java

Co-authored-by: Ilkka Seppälä <[email protected]>

* e.printStackTrace have changed to logger to prints standard output (STD OUT) .

* add programmatic example .

* Delete mvnw

* mvnw.cmd deleted .

* added mvnw from master

* AddUnitTest

* Add language to readme.md

Co-authored-by: Subhrodip Mohanta <[email protected]>
Co-authored-by: Ilkka Seppälä <[email protected]>
Co-authored-by: Subhrodip Mohanta <[email protected]>
Co-authored-by: Subhrodip Mohanta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Monitor Object pattern
4 participants