-
-
Notifications
You must be signed in to change notification settings - Fork 27.3k
Event sourcing #610
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
Event sourcing #610
Conversation
@radresian can you resolve the conflict please and I will review. |
@iluwatar conflict is resolved, also I added some comments on App class, added a Unit Test and replaced System.otuts with log4j logging. |
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.
The example has a lot of classes and seems awfully complex at the moment. Could you try to find ways to simplify it a bit?
|
||
/** | ||
* Created by Serdar Hamzaogullari on 06.08.2017. | ||
*/ |
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.
Can you add proper descriptions for the classes? What are the classes responsibilities. This occurs elsewhere too.
*/ | ||
public class AccountService { | ||
|
||
private EventProcessor eventProcessor; |
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.
Fields set only on construction should be final. Check elsewhere too.
public void depositMoney(int accountNo, BigDecimal money) { | ||
MoneyDepositEvent moneyDepositEvent = new MoneyDepositEvent( | ||
SequenceIdGenerator.nextSequenceId(), new Date().getTime(), accountNo, money); | ||
eventProcessor.process(moneyDepositEvent); |
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.
Seems unnecessary to create the temp variable. Could be written on one line. Check elsewhere for this too.
return sequenceId; | ||
} | ||
|
||
} |
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.
This class is not meant to be instantiated, right? It should have private constructor.
@@ -0,0 +1,115 @@ | |||
/** |
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.
The path of the test file is funny. It's usually src/test/java
, right? At the moment mvn clean install
doesn't run the test at all.
@radresian review comments given. Please let me know once you've implemented the changes. |
…ample - final fields are marked as final - removed unnecessary temp variables - added private constructor for not instantiated static class AccountAggregate - path of te test file is corrected
@iluwatar your change requests are implemented. I removed all optional classes and interfaces to simplify my example. |
Looks perfect @radresian Thank for for the new pattern 👍 |
No description provided.