-
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
CQRS pattern #595
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
CQRS pattern #595
Conversation
iluwatar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor issues were pointed out that should be addressed or answered. My apologies for taking so long to review this pull request.
cqrs/README.md
Outdated
| --- | ||
|
|
||
| ## Intent | ||
| CQRS Command Query Responsibility Segregation - Seperate the query side from the command side. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - "Seperate"
|
|
||
| /** | ||
| * CQRS : Command Query Responsibility Segregation. A pattern used to separate query services from commands or writes | ||
| * services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit longer explanation here would be appreciated. First describe the pattern and then tell how it is implemented in this example.
| System.out.println("jBloch number of books : " + jBlochBooksCount); | ||
| System.out.println("Number of authors : " + authorsCount); | ||
| System.out.println("DDD book : " + dddBook); | ||
| System.out.println("jBloch books : " + jBlochBooks); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of System.out.println you should use a logging framework. Check the other patterns for examples.
| session.close(); | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the methods may return null and this object (that is possibly null) is used for method calls which may result in null pointer exceptions. Is this the intended design?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I didn't pay attention. I guess it' ok, though I added a check so not add a book to a none existing author.
| return authorcount; | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try with resources structure would be suitable here to ensure closing of the session?
|
@isabiq review comments posted. Please notify when the changes are ready. |
|
@iluwatar no problem, here are my changes. I don't know what issues you meant, but I'm open to any discussions or suggestions regarding this pattern implementation. |
|
Looks good, great work @isabiq 👍 |
|
@all-contributors please add @isabiq for code |
|
I've put up a pull request to add @isabiq! 🎉 |
No description provided.