Skip to content

Conversation

@isabiq
Copy link
Contributor

@isabiq isabiq commented Jun 30, 2017

No description provided.

@isabiq isabiq changed the title CQRS pattern #105 CQRS pattern Jun 30, 2017
Copy link
Owner

@iluwatar iluwatar left a 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.
Copy link
Owner

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.
Copy link
Owner

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);
Copy link
Owner

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();
}

}
Copy link
Owner

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?

Copy link
Contributor Author

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;
}

}
Copy link
Owner

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?

@iluwatar
Copy link
Owner

@isabiq review comments posted. Please notify when the changes are ready.

@isabiq
Copy link
Contributor Author

isabiq commented Jul 29, 2017

@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.

@iluwatar
Copy link
Owner

Looks good, great work @isabiq 👍

@iluwatar iluwatar merged commit 0982f00 into iluwatar:master Jul 29, 2017
@iluwatar
Copy link
Owner

@all-contributors please add @isabiq for code

@allcontributors
Copy link
Contributor

@iluwatar

I've put up a pull request to add @isabiq! 🎉

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.

2 participants