Skip to content

Conversation

radresian
Copy link
Contributor

No description provided.

@iluwatar
Copy link
Owner

@radresian can you resolve the conflict please and I will review.

@radresian
Copy link
Contributor Author

@iluwatar conflict is resolved, also I added some comments on App class, added a Unit Test and replaced System.otuts with log4j logging.

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.

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

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

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

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

}
Copy link
Owner

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 @@
/**
Copy link
Owner

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.

@iluwatar
Copy link
Owner

@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
@radresian
Copy link
Contributor Author

@iluwatar your change requests are implemented. I removed all optional classes and interfaces to simplify my example.

@iluwatar iluwatar merged commit efc6eb8 into iluwatar:master Sep 3, 2017
@iluwatar
Copy link
Owner

iluwatar commented Sep 3, 2017

Looks perfect @radresian Thank for for the new pattern 👍

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